migrations/Version20220426145935.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 Version20220426145935 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 message_document_state_constraint (id INT NOT NULL, state VARCHAR(255) DEFAULT NULL, document VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('CREATE TABLE message_provider_type_constraint (id INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  20.         $this->addSql('CREATE TABLE message_provider_type_constraint_provider_type (message_provider_type_constraint_id INT NOT NULL, provider_type_id INT NOT NULL, INDEX IDX_99A701C65FED3B53 (message_provider_type_constraint_id), INDEX IDX_99A701C635142E34 (provider_type_id), PRIMARY KEY(message_provider_type_constraint_id, provider_type_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  21.         $this->addSql('CREATE TABLE provider_message_constraint (id INT AUTO_INCREMENT NOT NULL, message_id INT DEFAULT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', is_enabled TINYINT(1) NOT NULL, type VARCHAR(255) NOT NULL, INDEX IDX_B590206E537A1329 (message_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  22.         $this->addSql('ALTER TABLE message_document_state_constraint ADD CONSTRAINT FK_2F937C0BBF396750 FOREIGN KEY (id) REFERENCES provider_message_constraint (id) ON DELETE CASCADE');
  23.         $this->addSql('ALTER TABLE message_provider_type_constraint ADD CONSTRAINT FK_860D6EEBF396750 FOREIGN KEY (id) REFERENCES provider_message_constraint (id) ON DELETE CASCADE');
  24.         $this->addSql('ALTER TABLE message_provider_type_constraint_provider_type ADD CONSTRAINT FK_99A701C65FED3B53 FOREIGN KEY (message_provider_type_constraint_id) REFERENCES message_provider_type_constraint (id) ON DELETE CASCADE');
  25.         $this->addSql('ALTER TABLE message_provider_type_constraint_provider_type ADD CONSTRAINT FK_99A701C635142E34 FOREIGN KEY (provider_type_id) REFERENCES provider_type (id) ON DELETE CASCADE');
  26.         $this->addSql('ALTER TABLE provider_message_constraint ADD CONSTRAINT FK_B590206E537A1329 FOREIGN KEY (message_id) REFERENCES provider_message (id)');
  27.     }
  28.     public function down(Schema $schema): void
  29.     {
  30.         // this down() migration is auto-generated, please modify it to your needs
  31.         $this->addSql('ALTER TABLE message_provider_type_constraint_provider_type DROP FOREIGN KEY FK_99A701C65FED3B53');
  32.         $this->addSql('ALTER TABLE message_document_state_constraint DROP FOREIGN KEY FK_2F937C0BBF396750');
  33.         $this->addSql('ALTER TABLE message_provider_type_constraint DROP FOREIGN KEY FK_860D6EEBF396750');
  34.         $this->addSql('DROP TABLE message_document_state_constraint');
  35.         $this->addSql('DROP TABLE message_provider_type_constraint');
  36.         $this->addSql('DROP TABLE message_provider_type_constraint_provider_type');
  37.         $this->addSql('DROP TABLE provider_message_constraint');
  38.     }
  39. }