migrations/Version20220703134031.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 Version20220703134031 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('DROP TABLE subtheme');
  19.         $this->addSql('ALTER TABLE activity DROP price, CHANGE date_end date_end DATETIME DEFAULT NULL, CHANGE date_register_start date_register_start DATETIME DEFAULT NULL, CHANGE date_register_end date_register_end DATETIME DEFAULT NULL');
  20.         $this->addSql('ALTER TABLE school_activity ADD normal_price NUMERIC(5, 2) NOT NULL, ADD jette_price NUMERIC(5, 2) NOT NULL');
  21.     }
  22.     public function down(Schema $schema): void
  23.     {
  24.         // this down() migration is auto-generated, please modify it to your needs
  25.         $this->addSql('CREATE TABLE subtheme (subtheme_theme_id INT NOT NULL, theme_id INT NOT NULL, INDEX IDX_EDC608D29BC1E100 (subtheme_theme_id), INDEX IDX_EDC608D259027487 (theme_id), PRIMARY KEY(theme_id, subtheme_theme_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  26.         $this->addSql('ALTER TABLE subtheme ADD CONSTRAINT FK_EDC608D29BC1E100 FOREIGN KEY (subtheme_theme_id) REFERENCES theme (id)');
  27.         $this->addSql('ALTER TABLE subtheme ADD CONSTRAINT FK_EDC608D259027487 FOREIGN KEY (theme_id) REFERENCES theme (id)');
  28.         $this->addSql('ALTER TABLE activity ADD price NUMERIC(5, 2) NOT NULL, CHANGE date_end date_end DATETIME NOT NULL, CHANGE date_register_start date_register_start DATETIME NOT NULL, CHANGE date_register_end date_register_end DATETIME NOT NULL');
  29.         $this->addSql('ALTER TABLE school_activity DROP normal_price, DROP jette_price');
  30.     }
  31. }