migrations/Version20211007135500.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 Version20211007135500 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 graveyard_photo (graveyard_id INT NOT NULL, photo_id INT NOT NULL, INDEX IDX_C3F92FCAB0C855CA (graveyard_id), INDEX IDX_C3F92FCA7E9E4C8C (photo_id), PRIMARY KEY(graveyard_id, photo_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('CREATE TABLE memorial_card_photo (memorial_card_id INT NOT NULL, photo_id INT NOT NULL, INDEX IDX_54D7936839181E6 (memorial_card_id), INDEX IDX_54D79367E9E4C8C (photo_id), PRIMARY KEY(memorial_card_id, photo_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  20.         $this->addSql('ALTER TABLE graveyard_photo ADD CONSTRAINT FK_C3F92FCAB0C855CA FOREIGN KEY (graveyard_id) REFERENCES graveyard (id) ON DELETE CASCADE');
  21.         $this->addSql('ALTER TABLE graveyard_photo ADD CONSTRAINT FK_C3F92FCA7E9E4C8C FOREIGN KEY (photo_id) REFERENCES photo (id) ON DELETE CASCADE');
  22.         $this->addSql('ALTER TABLE memorial_card_photo ADD CONSTRAINT FK_54D7936839181E6 FOREIGN KEY (memorial_card_id) REFERENCES memorial_card (id) ON DELETE CASCADE');
  23.         $this->addSql('ALTER TABLE memorial_card_photo ADD CONSTRAINT FK_54D79367E9E4C8C FOREIGN KEY (photo_id) REFERENCES photo (id) ON DELETE CASCADE');
  24.     }
  25.     public function down(Schema $schema): void
  26.     {
  27.         // this down() migration is auto-generated, please modify it to your needs
  28.         $this->addSql('DROP TABLE graveyard_photo');
  29.         $this->addSql('DROP TABLE memorial_card_photo');
  30.     }
  31. }