Files
myep-team/migrations/Version20261110120000.php
T

35 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Written by hand from the diff, keeping only questionnaire_response: doctrine:migrations:diff
* also sweeps in the pre-existing drift of the dev database.
*/
final class Version20261110120000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Answer the bus feedback once per escorted leg';
}
public function up(Schema $schema): void
{
$this->addSql("ALTER TABLE questionnaire_response ADD leg VARCHAR(16) DEFAULT '' NOT NULL");
$this->addSql('DROP INDEX questionnaire_disposition ON questionnaire_response');
$this->addSql('CREATE UNIQUE INDEX questionnaire_disposition_leg ON questionnaire_response (questionnaire, disposition_id, leg)');
}
public function down(Schema $schema): void
{
$this->addSql('DROP INDEX questionnaire_disposition_leg ON questionnaire_response');
$this->addSql('CREATE UNIQUE INDEX questionnaire_disposition ON questionnaire_response (questionnaire, disposition_id)');
$this->addSql('ALTER TABLE questionnaire_response DROP leg');
}
}