<?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 Version20220425151130 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 engagement ADD citizen_id INT DEFAULT NULL, ADD begin_month VARCHAR(255) NOT NULL, ADD begin_year VARCHAR(255) NOT NULL, ADD end_month VARCHAR(255) DEFAULT NULL, ADD end_year VARCHAR(255) DEFAULT NULL, DROP begin, DROP end');
$this->addSql('ALTER TABLE engagement ADD CONSTRAINT FK_D86F0141A63C3C2E FOREIGN KEY (citizen_id) REFERENCES citizen (id)');
$this->addSql('CREATE INDEX IDX_D86F0141A63C3C2E ON engagement (citizen_id)');
$this->addSql('ALTER TABLE messenger_messages CHANGE queue_name queue_name VARCHAR(190) NOT NULL');
$this->addSql('CREATE INDEX IDX_75EA56E0FB7336F0 ON messenger_messages (queue_name)');
$this->addSql('CREATE INDEX IDX_75EA56E0E3BD61CE ON messenger_messages (available_at)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE engagement DROP FOREIGN KEY FK_D86F0141A63C3C2E');
$this->addSql('DROP INDEX IDX_D86F0141A63C3C2E ON engagement');
$this->addSql('ALTER TABLE engagement ADD begin DATE NOT NULL, ADD end DATE NOT NULL, DROP citizen_id, DROP begin_month, DROP begin_year, DROP end_month, DROP end_year');
$this->addSql('DROP INDEX IDX_75EA56E0FB7336F0 ON messenger_messages');
$this->addSql('DROP INDEX IDX_75EA56E0E3BD61CE ON messenger_messages');
$this->addSql('ALTER TABLE messenger_messages CHANGE queue_name queue_name VARCHAR(255) NOT NULL');
}
}