Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

Version20210824143117.php 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 Version20210824143117 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('CREATE TABLE dream (id INT AUTO_INCREMENT NOT NULL, individual_data_id INT DEFAULT NULL, collectif_data_id INT DEFAULT NULL, thematic_id INT DEFAULT NULL, description LONGTEXT NOT NULL, INDEX IDX_6A5F004FE2920B1 (individual_data_id), INDEX IDX_6A5F004FD9275BF1 (collectif_data_id), INDEX IDX_6A5F004F2395FCED (thematic_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19. $this->addSql('ALTER TABLE dream ADD CONSTRAINT FK_6A5F004FE2920B1 FOREIGN KEY (individual_data_id) REFERENCES individual_data (id)');
  20. $this->addSql('ALTER TABLE dream ADD CONSTRAINT FK_6A5F004FD9275BF1 FOREIGN KEY (collectif_data_id) REFERENCES collectif_data (id)');
  21. $this->addSql('ALTER TABLE dream ADD CONSTRAINT FK_6A5F004F2395FCED FOREIGN KEY (thematic_id) REFERENCES thematic (id)');
  22. $this->addSql('DROP TABLE dreams');
  23. }
  24. public function down(Schema $schema): void
  25. {
  26. // this down() migration is auto-generated, please modify it to your needs
  27. $this->addSql('CREATE TABLE dreams (id INT AUTO_INCREMENT NOT NULL, individual_data_id INT DEFAULT NULL, collectif_data_id INT DEFAULT NULL, thematic_id INT DEFAULT NULL, description LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_FD07CC0AE2920B1 (individual_data_id), INDEX IDX_FD07CC0AD9275BF1 (collectif_data_id), INDEX IDX_FD07CC0A2395FCED (thematic_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  28. $this->addSql('ALTER TABLE dreams ADD CONSTRAINT FK_FD07CC0A2395FCED FOREIGN KEY (thematic_id) REFERENCES thematic (id)');
  29. $this->addSql('ALTER TABLE dreams ADD CONSTRAINT FK_FD07CC0AD9275BF1 FOREIGN KEY (collectif_data_id) REFERENCES collectif_data (id)');
  30. $this->addSql('ALTER TABLE dreams ADD CONSTRAINT FK_FD07CC0AE2920B1 FOREIGN KEY (individual_data_id) REFERENCES individual_data (id)');
  31. $this->addSql('DROP TABLE dream');
  32. }
  33. }