<?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 Version20240528081324 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 image DROP FOREIGN KEY FK_C53D045FB5A459A0');
$this->addSql('DROP TABLE news');
$this->addSql('ALTER TABLE blog_article ADD date DATE DEFAULT NULL, DROP subtitle');
$this->addSql('DROP INDEX IDX_C53D045FB5A459A0 ON image');
$this->addSql('ALTER TABLE image DROP news_id');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE news (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, text LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, date DATE DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE blog_article ADD subtitle VARCHAR(255) DEFAULT NULL, DROP date');
$this->addSql('ALTER TABLE image ADD news_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE image ADD CONSTRAINT FK_C53D045FB5A459A0 FOREIGN KEY (news_id) REFERENCES news (id)');
$this->addSql('CREATE INDEX IDX_C53D045FB5A459A0 ON image (news_id)');
}
}