<?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 Version20230529081207 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 inspiration (id INT AUTO_INCREMENT NOT NULL, domain_id INT DEFAULT NULL, domain_lang_id INT DEFAULT NULL, media_id INT DEFAULT NULL, title VARCHAR(60) DEFAULT NULL, slug VARCHAR(255) NOT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, deleted_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_FDEC4440989D9B62 (slug), INDEX IDX_FDEC4440115F0EE5 (domain_id), INDEX IDX_FDEC4440E9F626BC (domain_lang_id), INDEX IDX_FDEC4440EA9FDD75 (media_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE inspiration ADD CONSTRAINT FK_FDEC4440115F0EE5 FOREIGN KEY (domain_id) REFERENCES domain (id)');
$this->addSql('ALTER TABLE inspiration ADD CONSTRAINT FK_FDEC4440E9F626BC FOREIGN KEY (domain_lang_id) REFERENCES domain_lang (id)');
$this->addSql('ALTER TABLE inspiration ADD CONSTRAINT FK_FDEC4440EA9FDD75 FOREIGN KEY (media_id) REFERENCES media__media (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE inspiration DROP FOREIGN KEY FK_FDEC4440115F0EE5');
$this->addSql('ALTER TABLE inspiration DROP FOREIGN KEY FK_FDEC4440E9F626BC');
$this->addSql('ALTER TABLE inspiration DROP FOREIGN KEY FK_FDEC4440EA9FDD75');
$this->addSql('DROP TABLE inspiration');
}
}