migrations/Version20220712083901.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20220712083901 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('ALTER TABLE article DROP FOREIGN KEY FK_23A0E665053569B');
  19.         $this->addSql('ALTER TABLE article DROP FOREIGN KEY FK_23A0E66BCF5E72D');
  20.         $this->addSql('ALTER TABLE article DROP FOREIGN KEY FK_23A0E66764D0490');
  21.         $this->addSql('ALTER TABLE article ADD CONSTRAINT FK_23A0E665053569B FOREIGN KEY (formulaire_id) REFERENCES formulaire (id) ON DELETE SET NULL');
  22.         $this->addSql('ALTER TABLE article ADD CONSTRAINT FK_23A0E66BCF5E72D FOREIGN KEY (categorie_id) REFERENCES article_categorie (id) ON DELETE SET NULL');
  23.         $this->addSql('ALTER TABLE article ADD CONSTRAINT FK_23A0E66764D0490 FOREIGN KEY (redacteur_id) REFERENCES user (id) ON DELETE SET NULL');
  24.         $this->addSql('ALTER TABLE formulaire_champ DROP FOREIGN KEY FK_D9A116179B9F4ACA');
  25.         $this->addSql('ALTER TABLE formulaire_champ ADD CONSTRAINT FK_D9A116179B9F4ACA FOREIGN KEY (formulaire_recap_id) REFERENCES formulaire_recap (id) ON DELETE SET NULL');
  26.         $this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB6205053569B');
  27.         $this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB6205053569B FOREIGN KEY (formulaire_id) REFERENCES formulaire (id) ON DELETE SET NULL');
  28.         $this->addSql('ALTER TABLE projet DROP FOREIGN KEY FK_50159CA919EB6921');
  29.         $this->addSql('ALTER TABLE projet ADD CONSTRAINT FK_50159CA919EB6921 FOREIGN KEY (client_id) REFERENCES user (id) ON DELETE SET NULL');
  30.         $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649C18272');
  31.         $this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D649C18272 FOREIGN KEY (projet_id) REFERENCES projet (id) ON DELETE SET NULL');
  32.     }
  33.     public function down(Schema $schema): void
  34.     {
  35.         // this down() migration is auto-generated, please modify it to your needs
  36.         $this->addSql('ALTER TABLE article DROP FOREIGN KEY FK_23A0E66BCF5E72D');
  37.         $this->addSql('ALTER TABLE article DROP FOREIGN KEY FK_23A0E66764D0490');
  38.         $this->addSql('ALTER TABLE article DROP FOREIGN KEY FK_23A0E665053569B');
  39.         $this->addSql('ALTER TABLE article ADD CONSTRAINT FK_23A0E66BCF5E72D FOREIGN KEY (categorie_id) REFERENCES article_categorie (id)');
  40.         $this->addSql('ALTER TABLE article ADD CONSTRAINT FK_23A0E66764D0490 FOREIGN KEY (redacteur_id) REFERENCES user (id)');
  41.         $this->addSql('ALTER TABLE article ADD CONSTRAINT FK_23A0E665053569B FOREIGN KEY (formulaire_id) REFERENCES formulaire (id)');
  42.         $this->addSql('ALTER TABLE formulaire_champ DROP FOREIGN KEY FK_D9A116179B9F4ACA');
  43.         $this->addSql('ALTER TABLE formulaire_champ ADD CONSTRAINT FK_D9A116179B9F4ACA FOREIGN KEY (formulaire_recap_id) REFERENCES formulaire_recap (id)');
  44.         $this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB6205053569B');
  45.         $this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB6205053569B FOREIGN KEY (formulaire_id) REFERENCES formulaire (id)');
  46.         $this->addSql('ALTER TABLE projet DROP FOREIGN KEY FK_50159CA919EB6921');
  47.         $this->addSql('ALTER TABLE projet ADD CONSTRAINT FK_50159CA919EB6921 FOREIGN KEY (client_id) REFERENCES user (id)');
  48.         $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649C18272');
  49.         $this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D649C18272 FOREIGN KEY (projet_id) REFERENCES projet (id)');
  50.     }
  51. }