<?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 Version20221031192828 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 artobject_exhibitionlink (artobject_id INT NOT NULL, exhibitionlink_id INT NOT NULL, INDEX IDX_BE25A51454EA6A5D (artobject_id), INDEX IDX_BE25A51483C389D0 (exhibitionlink_id), PRIMARY KEY(artobject_id, exhibitionlink_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE artobject_tourlink (artobject_id INT NOT NULL, tourlink_id INT NOT NULL, INDEX IDX_2A8BEB6654EA6A5D (artobject_id), INDEX IDX_2A8BEB6661190218 (tourlink_id), PRIMARY KEY(artobject_id, tourlink_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE artobject_assignmentlink (artobject_id INT NOT NULL, assignmentlink_id INT NOT NULL, INDEX IDX_FADA662154EA6A5D (artobject_id), INDEX IDX_FADA66216CB6C5EF (assignmentlink_id), PRIMARY KEY(artobject_id, assignmentlink_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE artobject_exhibitionlink ADD CONSTRAINT FK_BE25A51454EA6A5D FOREIGN KEY (artobject_id) REFERENCES ArtObject (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE artobject_exhibitionlink ADD CONSTRAINT FK_BE25A51483C389D0 FOREIGN KEY (exhibitionlink_id) REFERENCES ExhibitionLink (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE artobject_tourlink ADD CONSTRAINT FK_2A8BEB6654EA6A5D FOREIGN KEY (artobject_id) REFERENCES ArtObject (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE artobject_tourlink ADD CONSTRAINT FK_2A8BEB6661190218 FOREIGN KEY (tourlink_id) REFERENCES TourLink (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE artobject_assignmentlink ADD CONSTRAINT FK_FADA662154EA6A5D FOREIGN KEY (artobject_id) REFERENCES ArtObject (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE artobject_assignmentlink ADD CONSTRAINT FK_FADA66216CB6C5EF FOREIGN KEY (assignmentlink_id) REFERENCES AssignmentLink (id) ON DELETE CASCADE');
$this->addSql('DROP TABLE artobject_assignment');
$this->addSql('DROP TABLE artobject_exhibition');
$this->addSql('DROP TABLE artobject_tour');
$this->addSql('ALTER TABLE Map ADD enabled TINYINT(1) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE artobject_assignment (artobject_id INT NOT NULL, assignment_id INT NOT NULL, INDEX IDX_1B9A8E454EA6A5D (artobject_id), INDEX IDX_1B9A8E4D19302F8 (assignment_id), PRIMARY KEY(artobject_id, assignment_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE artobject_exhibition (artobject_id INT NOT NULL, exhibition_id INT NOT NULL, INDEX IDX_8949DFD72A7D4494 (exhibition_id), INDEX IDX_8949DFD754EA6A5D (artobject_id), PRIMARY KEY(artobject_id, exhibition_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE artobject_tour (artobject_id INT NOT NULL, tour_id INT NOT NULL, INDEX IDX_A1CE104A15ED8D43 (tour_id), INDEX IDX_A1CE104A54EA6A5D (artobject_id), PRIMARY KEY(artobject_id, tour_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE artobject_assignment ADD CONSTRAINT FK_1B9A8E454EA6A5D FOREIGN KEY (artobject_id) REFERENCES ArtObject (id) ON UPDATE NO ACTION ON DELETE CASCADE');
$this->addSql('ALTER TABLE artobject_assignment ADD CONSTRAINT FK_1B9A8E4D19302F8 FOREIGN KEY (assignment_id) REFERENCES Assignment (id) ON UPDATE NO ACTION ON DELETE CASCADE');
$this->addSql('ALTER TABLE artobject_exhibition ADD CONSTRAINT FK_8949DFD72A7D4494 FOREIGN KEY (exhibition_id) REFERENCES Exhibition (id) ON UPDATE NO ACTION ON DELETE CASCADE');
$this->addSql('ALTER TABLE artobject_exhibition ADD CONSTRAINT FK_8949DFD754EA6A5D FOREIGN KEY (artobject_id) REFERENCES ArtObject (id) ON UPDATE NO ACTION ON DELETE CASCADE');
$this->addSql('ALTER TABLE artobject_tour ADD CONSTRAINT FK_A1CE104A15ED8D43 FOREIGN KEY (tour_id) REFERENCES Tour (id) ON UPDATE NO ACTION ON DELETE CASCADE');
$this->addSql('ALTER TABLE artobject_tour ADD CONSTRAINT FK_A1CE104A54EA6A5D FOREIGN KEY (artobject_id) REFERENCES ArtObject (id) ON UPDATE NO ACTION ON DELETE CASCADE');
$this->addSql('DROP TABLE artobject_exhibitionlink');
$this->addSql('DROP TABLE artobject_tourlink');
$this->addSql('DROP TABLE artobject_assignmentlink');
$this->addSql('ALTER TABLE Map DROP enabled');
}
}