39 lines
1.3 KiB
PHP
39 lines
1.3 KiB
PHP
<?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 Version20241121140219 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 announcement DROP CONSTRAINT fk_4db9d91c6bf700bd');
|
|
$this->addSql('DROP INDEX idx_4db9d91c6bf700bd');
|
|
$this->addSql('ALTER TABLE announcement ADD status VARCHAR(255) NOT NULL');
|
|
$this->addSql('ALTER TABLE announcement DROP status_id');
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
// this down() migration is auto-generated, please modify it to your needs
|
|
$this->addSql('CREATE SCHEMA public');
|
|
$this->addSql('ALTER TABLE announcement ADD status_id INT NOT NULL');
|
|
$this->addSql('ALTER TABLE announcement DROP status');
|
|
$this->addSql('ALTER TABLE announcement ADD CONSTRAINT fk_4db9d91c6bf700bd FOREIGN KEY (status_id) REFERENCES status (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
|
$this->addSql('CREATE INDEX idx_4db9d91c6bf700bd ON announcement (status_id)');
|
|
}
|
|
}
|