diff --git a/migrations/Version20211215132322.php b/migrations/Version20211215142553.php similarity index 75% rename from migrations/Version20211215132322.php rename to migrations/Version20211215142553.php index b957dafcde370943e9b7d0477b50ef206ec0db6a..548a22b458389f7504fe3e4a84055a1b53781630 100644 --- a/migrations/Version20211215132322.php +++ b/migrations/Version20211215142553.php @@ -10,7 +10,7 @@ use Doctrine\Migrations\AbstractMigration; /** * Auto-generated Migration: Please modify to your needs! */ -final class Version20211215132322 extends AbstractMigration +final class Version20211215142553 extends AbstractMigration { public function getDescription(): string { @@ -20,7 +20,7 @@ final class Version20211215132322 extends AbstractMigration public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE TABLE capsule (id INT AUTO_INCREMENT NOT NULL, nom VARCHAR(255) NOT NULL, aut_crea VARCHAR(255) NOT NULL, dt_crea DATETIME NOT NULL, aut_maj VARCHAR(255) NOT NULL, dt_maj DATETIME NOT NULL, link VARCHAR(255) NOT NULL, edition_link VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE capsule (id INT AUTO_INCREMENT NOT NULL, nom VARCHAR(255) NOT NULL, aut_crea INT NOT NULL, dt_crea DATETIME NOT NULL, aut_maj INT DEFAULT 0 NOT NULL, dt_maj DATETIME DEFAULT \'0\' NOT NULL, link VARCHAR(255) NOT NULL, edition_link VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB'); $this->addSql('CREATE TABLE editeur_capsule (capsule_id INT NOT NULL, user_id INT NOT NULL, INDEX IDX_A18592E2714704E9 (capsule_id), INDEX IDX_A18592E2A76ED395 (user_id), PRIMARY KEY(capsule_id, user_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB'); $this->addSql('ALTER TABLE editeur_capsule ADD CONSTRAINT FK_A18592E2714704E9 FOREIGN KEY (capsule_id) REFERENCES capsule (id) ON DELETE CASCADE'); $this->addSql('ALTER TABLE editeur_capsule ADD CONSTRAINT FK_A18592E2A76ED395 FOREIGN KEY (user_id) REFERENCES `user` (id) ON DELETE CASCADE'); @@ -30,6 +30,7 @@ final class Version20211215132322 extends AbstractMigration { // this down() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE editeur_capsule DROP FOREIGN KEY FK_A18592E2714704E9'); + $this->addSql('ALTER TABLE editeur_capsule DROP FOREIGN KEY FK_A18592E2A76ED395'); $this->addSql('DROP TABLE capsule'); $this->addSql('DROP TABLE editeur_capsule'); }