Files
TijdVoorDeTest/migrations/Version20260704200000.php
Marijn 8304d8680b feat: address PR review comments — unassign/sync bank questions, blank quiz creation, deactivate redirect, remove duplicate tab titles
- Use Symfony ObjectMapper for BankQuestion/BankAnswer → Question/Answer copy (#[Map(if: false)] on id, season, etc.)
- Track created Question on BankQuestionUsage (nullable FK, onDelete: SET NULL) for unassign/sync support
- Add unassign route: removes the Question copy + usage record
- Add sync route: pushes bank question edits to a finalized-not-started quiz copy
- Auto-sync non-finalized quiz copies on bank question edit; flash warning for finalized-not-started
- Add blank quiz creation (no XLSX required) with new route + template
- Deactivate quiz button now stays on the quiz overview page (redirect_quiz hidden field)
- Remove duplicate h4 titles below the tab bar on all season tabs
- Add migration for bank_question_usage.question_id
- Add Dutch translations for all new strings
2026-07-04 21:54:44 +02:00

33 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260704200000 extends AbstractMigration
{
#[\Override]
public function getDescription(): string
{
return 'Add question_id FK to bank_question_usage for unassign and sync support';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE bank_question_usage ADD question_id UUID DEFAULT NULL');
$this->addSql('ALTER TABLE bank_question_usage ADD CONSTRAINT FK_BQU_QUESTION FOREIGN KEY (question_id) REFERENCES question (id) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_BQU_QUESTION ON bank_question_usage (question_id)');
}
#[\Override]
public function down(Schema $schema): void
{
$this->addSql('DROP INDEX IDX_BQU_QUESTION');
$this->addSql('ALTER TABLE bank_question_usage DROP CONSTRAINT FK_BQU_QUESTION');
$this->addSql('ALTER TABLE bank_question_usage DROP COLUMN question_id');
}
}