migrations/Version20230111212436.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 Version20230111212436 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 mobile_parent_app_account_activity (id INT AUTO_INCREMENT NOT NULL, mobile_parent_app_account_id INT DEFAULT NULL, type VARCHAR(128) DEFAULT NULL, description LONGTEXT DEFAULT NULL, create_at DATE DEFAULT NULL COMMENT \'(DC2Type:date_immutable)\', created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', created_by INT NOT NULL, updated_by INT NOT NULL, INDEX IDX_A3DD3B2BD12D991B (mobile_parent_app_account_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE mobile_parent_app_account_activity ADD CONSTRAINT FK_A3DD3B2BD12D991B FOREIGN KEY (mobile_parent_app_account_id) REFERENCES mobile_parent_app_account (id)');
  20.         $this->addSql('ALTER TABLE equivalent_matter ADD parent_id INT DEFAULT NULL, ADD num_order INT DEFAULT NULL');
  21.         $this->addSql('ALTER TABLE equivalent_matter ADD CONSTRAINT FK_842652C2727ACA70 FOREIGN KEY (parent_id) REFERENCES equivalent_matter (id)');
  22.         $this->addSql('CREATE INDEX IDX_842652C2727ACA70 ON equivalent_matter (parent_id)');
  23.         $this->addSql('ALTER TABLE school_sub_matter ADD equivalent_matter_id INT DEFAULT NULL');
  24.         $this->addSql('ALTER TABLE school_sub_matter ADD CONSTRAINT FK_B72E54D1AEEA3DB1 FOREIGN KEY (equivalent_matter_id) REFERENCES equivalent_matter (id)');
  25.         $this->addSql('CREATE INDEX IDX_B72E54D1AEEA3DB1 ON school_sub_matter (equivalent_matter_id)');
  26.     }
  27.     public function down(Schema $schema): void
  28.     {
  29.         // this down() migration is auto-generated, please modify it to your needs
  30.         $this->addSql('DROP TABLE mobile_parent_app_account_activity');
  31.         $this->addSql('ALTER TABLE equivalent_matter DROP FOREIGN KEY FK_842652C2727ACA70');
  32.         $this->addSql('DROP INDEX IDX_842652C2727ACA70 ON equivalent_matter');
  33.         $this->addSql('ALTER TABLE equivalent_matter DROP parent_id, DROP num_order');
  34.         $this->addSql('ALTER TABLE school_sub_matter DROP FOREIGN KEY FK_B72E54D1AEEA3DB1');
  35.         $this->addSql('DROP INDEX IDX_B72E54D1AEEA3DB1 ON school_sub_matter');
  36.         $this->addSql('ALTER TABLE school_sub_matter DROP equivalent_matter_id');
  37.     }
  38. }