migrations/Version20240526165228.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20240526165228 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $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');
  19.         $this->addSql('ALTER TABLE wave_payment ADD CONSTRAINT FK_2BBC6CC18565851 FOREIGN KEY (establishment_id) REFERENCES establishment (id)');
  20.         $this->addSql('ALTER TABLE wave_payment ADD CONSTRAINT FK_2BBC6CC1DF990765 FOREIGN KEY (student_registration_id) REFERENCES registration_student_registration (id)');
  21.         $this->addSql('ALTER TABLE wave_payment ADD CONSTRAINT FK_2BBC6CC1D2EECC3F FOREIGN KEY (school_year_id) REFERENCES school_year (id)');
  22.         $this->addSql('ALTER TABLE accounting_student_registration_payment CHANGE code code VARCHAR(255) NOT NULL');
  23.     }
  24.     public function down(Schema $schema): void
  25.     {
  26.         // this down() migration is auto-generated, please modify it to your needs
  27.         $this->addSql('DROP TABLE wave_payment');
  28.         $this->addSql('ALTER TABLE accounting_student_registration_payment CHANGE code code VARCHAR(60) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`');
  29.     }
  30. }