<?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 Version20230329162733 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 event ADD published TINYINT(1) DEFAULT NULL, CHANGE title title VARCHAR(255) NOT NULL, CHANGE cost cost NUMERIC(10, 0) DEFAULT NULL');
$this->addSql('CREATE UNIQUE INDEX UNIQ_3BAE0AA72B36786B ON event (title)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_3BAE0AA7989D9B62 ON event (slug)');
$this->addSql('ALTER TABLE news ADD published TINYINT(1) DEFAULT NULL, CHANGE title title VARCHAR(255) NOT NULL');
$this->addSql('CREATE UNIQUE INDEX UNIQ_1DD399502B36786B ON news (title)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP INDEX UNIQ_3BAE0AA72B36786B ON `event`');
$this->addSql('DROP INDEX UNIQ_3BAE0AA7989D9B62 ON `event`');
$this->addSql('ALTER TABLE `event` DROP published, CHANGE title title LONGTEXT NOT NULL, CHANGE cost cost VARCHAR(50) DEFAULT NULL');
$this->addSql('DROP INDEX UNIQ_1DD399502B36786B ON news');
$this->addSql('ALTER TABLE news DROP published, CHANGE title title LONGTEXT NOT NULL');
}
}