<?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 Version20211007135500 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 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');
$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');
$this->addSql('ALTER TABLE graveyard_photo ADD CONSTRAINT FK_C3F92FCAB0C855CA FOREIGN KEY (graveyard_id) REFERENCES graveyard (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE graveyard_photo ADD CONSTRAINT FK_C3F92FCA7E9E4C8C FOREIGN KEY (photo_id) REFERENCES photo (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE memorial_card_photo ADD CONSTRAINT FK_54D7936839181E6 FOREIGN KEY (memorial_card_id) REFERENCES memorial_card (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE memorial_card_photo ADD CONSTRAINT FK_54D79367E9E4C8C FOREIGN KEY (photo_id) REFERENCES photo (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE graveyard_photo');
$this->addSql('DROP TABLE memorial_card_photo');
}
}