src/Migrations/Version20230809111251.php line 1
<?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 Version20230809111251 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('ALTER TABLE gallery_album DROP FOREIGN KEY FK_DD05BE60CDE46FDB');
$this->addSql('DROP INDEX IDX_DD05BE60CDE46FDB ON gallery_album');
$this->addSql('ALTER TABLE gallery_album CHANGE preview_id preview_image_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE gallery_album ADD CONSTRAINT FK_DD05BE60FAE957CD FOREIGN KEY (preview_image_id) REFERENCES files (id)');
$this->addSql('CREATE INDEX IDX_DD05BE60FAE957CD ON gallery_album (preview_image_id)');
$this->addSql('ALTER TABLE gallery_group DROP FOREIGN KEY FK_895D94E6CDE46FDB');
$this->addSql('DROP INDEX IDX_895D94E6CDE46FDB ON gallery_group');
$this->addSql('ALTER TABLE gallery_group CHANGE preview_id preview_image_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE gallery_group ADD CONSTRAINT FK_895D94E6FAE957CD FOREIGN KEY (preview_image_id) REFERENCES files (id)');
$this->addSql('CREATE INDEX IDX_895D94E6FAE957CD ON gallery_group (preview_image_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE gallery_album DROP FOREIGN KEY FK_DD05BE60FAE957CD');
$this->addSql('DROP INDEX IDX_DD05BE60FAE957CD ON gallery_album');
$this->addSql('ALTER TABLE gallery_album CHANGE preview_image_id preview_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE gallery_album ADD CONSTRAINT FK_DD05BE60CDE46FDB FOREIGN KEY (preview_id) REFERENCES files (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('CREATE INDEX IDX_DD05BE60CDE46FDB ON gallery_album (preview_id)');
$this->addSql('ALTER TABLE gallery_group DROP FOREIGN KEY FK_895D94E6FAE957CD');
$this->addSql('DROP INDEX IDX_895D94E6FAE957CD ON gallery_group');
$this->addSql('ALTER TABLE gallery_group CHANGE preview_image_id preview_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE gallery_group ADD CONSTRAINT FK_895D94E6CDE46FDB FOREIGN KEY (preview_id) REFERENCES files (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('CREATE INDEX IDX_895D94E6CDE46FDB ON gallery_group (preview_id)');
}
}