<?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 Version20220928062352 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 news ADD published_by_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE news ADD is_published BOOLEAN DEFAULT NULL');
$this->addSql('ALTER TABLE news ADD published_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
$this->addSql('COMMENT ON COLUMN news.is_published IS \'Признак публикации\'');
$this->addSql('COMMENT ON COLUMN news.published_at IS \'Дата публикации\'');
$this->addSql('ALTER TABLE news ADD CONSTRAINT FK_1DD399505B075477 FOREIGN KEY (published_by_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_1DD399505B075477 ON news (published_by_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE news DROP CONSTRAINT FK_1DD399505B075477');
$this->addSql('DROP INDEX IDX_1DD399505B075477');
$this->addSql('ALTER TABLE news DROP published_by_id');
$this->addSql('ALTER TABLE news DROP is_published');
$this->addSql('ALTER TABLE news DROP published_at');
}
}