migrations/2021/04/Version20210413115727.php line 1
<?phpdeclare(strict_types=1);namespace DoctrineMigrations;use Doctrine\DBAL\Schema\Schema;use Doctrine\Migrations\AbstractMigration;final class Version20210413115727 extends AbstractMigration{public function up(Schema $schema): void{$this->addSql('CREATE TABLE app_notification (id BINARY(16) NOT NULL COMMENT \'(DC2Type:notification_id)\', recipient_id BINARY(16) NOT NULL COMMENT \'(DC2Type:contact_id)\', sender_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:contact_id)\', created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', subject VARCHAR(255) NOT NULL, content LONGTEXT NOT NULL, INDEX IDX_7DDA6C4BE92F8F78 (recipient_id), INDEX IDX_7DDA6C4BF624B39D (sender_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');$this->addSql('CREATE TABLE app_notification_log (id BINARY(16) NOT NULL COMMENT \'(DC2Type:notification_log_id)\', created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:contact_id)\', notification_id BINARY(16) NOT NULL COMMENT \'(DC2Type:notification_id)\', created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_9AEFBC53B03A8386 (created_by_id), INDEX IDX_9AEFBC53EF1A9D84 (notification_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');$this->addSql('CREATE TABLE app_notification_scheduler (id BINARY(16) NOT NULL COMMENT \'(DC2Type:notification_scheduler_id)\', recipient_id BINARY(16) NOT NULL COMMENT \'(DC2Type:contact_id)\', sender_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:contact_id)\', active_from DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', active_to DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', last_run_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_CDCF18DDE92F8F78 (recipient_id), INDEX IDX_CDCF18DDF624B39D (sender_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');$this->addSql('ALTER TABLE app_notification ADD CONSTRAINT FK_7DDA6C4BE92F8F78 FOREIGN KEY (recipient_id) REFERENCES contact (id)');$this->addSql('ALTER TABLE app_notification ADD CONSTRAINT FK_7DDA6C4BF624B39D FOREIGN KEY (sender_id) REFERENCES contact (id)');$this->addSql('ALTER TABLE app_notification_log ADD CONSTRAINT FK_9AEFBC53B03A8386 FOREIGN KEY (created_by_id) REFERENCES contact (id)');$this->addSql('ALTER TABLE app_notification_log ADD CONSTRAINT FK_9AEFBC53EF1A9D84 FOREIGN KEY (notification_id) REFERENCES app_notification (id)');$this->addSql('ALTER TABLE app_notification_scheduler ADD CONSTRAINT FK_CDCF18DDE92F8F78 FOREIGN KEY (recipient_id) REFERENCES contact (id)');$this->addSql('ALTER TABLE app_notification_scheduler ADD CONSTRAINT FK_CDCF18DDF624B39D FOREIGN KEY (sender_id) REFERENCES contact (id)');$this->addSql('DROP INDEX UNIQ_9065174439E6FA16 ON invoice');$this->addSql('ALTER TABLE invoice DROP old_id');}public function down(Schema $schema): void{$this->addSql('ALTER TABLE app_notification_log DROP FOREIGN KEY FK_9AEFBC53EF1A9D84');$this->addSql('DROP TABLE app_notification');$this->addSql('DROP TABLE app_notification_log');$this->addSql('DROP TABLE app_notification_scheduler');$this->addSql('ALTER TABLE invoice ADD old_id INT DEFAULT NULL');$this->addSql('CREATE UNIQUE INDEX UNIQ_9065174439E6FA16 ON invoice (old_id)');}}