<?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 Version20220426145935 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 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');
$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');
$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');
$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');
$this->addSql('ALTER TABLE message_document_state_constraint ADD CONSTRAINT FK_2F937C0BBF396750 FOREIGN KEY (id) REFERENCES provider_message_constraint (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE message_provider_type_constraint ADD CONSTRAINT FK_860D6EEBF396750 FOREIGN KEY (id) REFERENCES provider_message_constraint (id) ON DELETE CASCADE');
$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');
$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');
$this->addSql('ALTER TABLE provider_message_constraint ADD CONSTRAINT FK_B590206E537A1329 FOREIGN KEY (message_id) REFERENCES provider_message (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE message_provider_type_constraint_provider_type DROP FOREIGN KEY FK_99A701C65FED3B53');
$this->addSql('ALTER TABLE message_document_state_constraint DROP FOREIGN KEY FK_2F937C0BBF396750');
$this->addSql('ALTER TABLE message_provider_type_constraint DROP FOREIGN KEY FK_860D6EEBF396750');
$this->addSql('DROP TABLE message_document_state_constraint');
$this->addSql('DROP TABLE message_provider_type_constraint');
$this->addSql('DROP TABLE message_provider_type_constraint_provider_type');
$this->addSql('DROP TABLE provider_message_constraint');
}
}