|
- <?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 Version20210623142443 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 group_user (id INT AUTO_INCREMENT NOT NULL, created_by_id INT NOT NULL, updated_by_id INT NOT NULL, title VARCHAR(255) NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_A4C98D39B03A8386 (created_by_id), INDEX IDX_A4C98D39896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
- $this->addSql('CREATE TABLE reminder (id INT AUTO_INCREMENT NOT NULL, created_by_id INT NOT NULL, updated_by_id INT NOT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, crud_action VARCHAR(64) DEFAULT NULL, crud_controller_fqcn VARCHAR(255) DEFAULT NULL, entity_id INT DEFAULT NULL, date_reminder DATE DEFAULT NULL, done TINYINT(1) NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_40374F40B03A8386 (created_by_id), INDEX IDX_40374F40896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
- $this->addSql('CREATE TABLE reminder_user_interface (reminder_id INT NOT NULL, user_interface_id INT NOT NULL, INDEX IDX_7FD2584BD987BE75 (reminder_id), INDEX IDX_7FD2584B2BC79580 (user_interface_id), PRIMARY KEY(reminder_id, user_interface_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
- $this->addSql('CREATE TABLE user_group_user_interface (user_id INT NOT NULL, group_user_interface_id INT NOT NULL, INDEX IDX_12B87B34A76ED395 (user_id), INDEX IDX_12B87B34F583BABC (group_user_interface_id), PRIMARY KEY(user_id, group_user_interface_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
- $this->addSql('ALTER TABLE group_user ADD CONSTRAINT FK_A4C98D39B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
- $this->addSql('ALTER TABLE group_user ADD CONSTRAINT FK_A4C98D39896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
- $this->addSql('ALTER TABLE reminder ADD CONSTRAINT FK_40374F40B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
- $this->addSql('ALTER TABLE reminder ADD CONSTRAINT FK_40374F40896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
- $this->addSql('ALTER TABLE reminder_user_interface ADD CONSTRAINT FK_7FD2584BD987BE75 FOREIGN KEY (reminder_id) REFERENCES reminder (id) ON DELETE CASCADE');
- $this->addSql('ALTER TABLE reminder_user_interface ADD CONSTRAINT FK_7FD2584B2BC79580 FOREIGN KEY (user_interface_id) REFERENCES user (id) ON DELETE CASCADE');
- $this->addSql('ALTER TABLE user_group_user_interface ADD CONSTRAINT FK_12B87B34A76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE');
- $this->addSql('ALTER TABLE user_group_user_interface ADD CONSTRAINT FK_12B87B34F583BABC FOREIGN KEY (group_user_interface_id) REFERENCES group_user (id) ON DELETE CASCADE');
- }
-
- public function down(Schema $schema): void
- {
- // this down() migration is auto-generated, please modify it to your needs
- $this->addSql('ALTER TABLE user_group_user_interface DROP FOREIGN KEY FK_12B87B34F583BABC');
- $this->addSql('ALTER TABLE reminder_user_interface DROP FOREIGN KEY FK_7FD2584BD987BE75');
- $this->addSql('DROP TABLE group_user');
- $this->addSql('DROP TABLE reminder');
- $this->addSql('DROP TABLE reminder_user_interface');
- $this->addSql('DROP TABLE user_group_user_interface');
- }
- }
|