<?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 Version20250109101735 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 information_popup (id CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', title VARCHAR(255) NOT NULL, content LONGTEXT NOT NULL, validation_button_text VARCHAR(100) NOT NULL, closing_button_text VARCHAR(100) NOT NULL, enabled TINYINT(1) DEFAULT \'0\' NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_general_ci` ENGINE = InnoDB'); $this->addSql('CREATE TABLE information_popup_user (id INT AUTO_INCREMENT NOT NULL, information_popup_id CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', user_id CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', has_validated TINYINT(1) DEFAULT \'0\' NOT NULL, INDEX IDX_9AA7FF00FBB63E47 (information_popup_id), INDEX IDX_9AA7FF00A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_general_ci` ENGINE = InnoDB'); $this->addSql('ALTER TABLE information_popup_user ADD CONSTRAINT FK_9AA7FF00FBB63E47 FOREIGN KEY (information_popup_id) REFERENCES information_popup (id)'); $this->addSql('ALTER TABLE information_popup_user ADD CONSTRAINT FK_9AA7FF00A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)'); } public function down(Schema $schema) : void { // this down() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE information_popup_user DROP FOREIGN KEY FK_9AA7FF00FBB63E47'); $this->addSql('DROP TABLE information_popup'); $this->addSql('DROP TABLE information_popup_user'); } }