<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240526165228 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE wave_payment (id INT AUTO_INCREMENT NOT NULL, establishment_id INT NOT NULL, student_registration_id INT NOT NULL, school_year_id INT NOT NULL, client_reference VARCHAR(255) NOT NULL, reference VARCHAR(255) NOT NULL, currency VARCHAR(255) NOT NULL, amount DOUBLE PRECISION NOT NULL, error_url LONGTEXT DEFAULT NULL, success_url LONGTEXT DEFAULT NULL, create_date DATE NOT NULL COMMENT \'(DC2Type:date_immutable)\', created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', validated_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', created_by INT NOT NULL, updated_by INT NOT NULL, is_validated TINYINT(1) NOT NULL, INDEX IDX_2BBC6CC18565851 (establishment_id), INDEX IDX_2BBC6CC1DF990765 (student_registration_id), INDEX IDX_2BBC6CC1D2EECC3F (school_year_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE wave_payment ADD CONSTRAINT FK_2BBC6CC18565851 FOREIGN KEY (establishment_id) REFERENCES establishment (id)');
$this->addSql('ALTER TABLE wave_payment ADD CONSTRAINT FK_2BBC6CC1DF990765 FOREIGN KEY (student_registration_id) REFERENCES registration_student_registration (id)');
$this->addSql('ALTER TABLE wave_payment ADD CONSTRAINT FK_2BBC6CC1D2EECC3F FOREIGN KEY (school_year_id) REFERENCES school_year (id)');
$this->addSql('ALTER TABLE accounting_student_registration_payment CHANGE code code VARCHAR(255) NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE wave_payment');
$this->addSql('ALTER TABLE accounting_student_registration_payment CHANGE code code VARCHAR(60) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`');
}
}