Merge pull request 'Remove dead code and validate new polls only once' (#33) from chore/remove-dead-code into main
CI / Deploy / test (push) Successful in 52s
CI / Deploy / deploy (push) Successful in 5s

Reviewed-on: #33
This commit was merged in pull request #33.
This commit is contained in:
gnilebein committed 2026-11-08 22:32:02 +01:00
commit a62e13eeff
13 files changed
+78 -102

No files matched your search

@@ -0,0 +1,37 @@
<?php
declare(strict_types=1);
use Migrations\BaseMigration;
/**
* polls.show_results_to_participants is unused: results belong on the stage, participants
* only get them where they interact with them (see PollStateService). There is no switch per poll.
*/
class DropShowResultsToParticipants extends BaseMigration
{
/**
* @return void
*/
public function up(): void
{
$table = $this->table('polls');
if ($table->hasColumn('show_results_to_participants')) {
$table->removeColumn('show_results_to_participants')->update();
}
}
/**
* @return void
*/
public function down(): void
{
$table = $this->table('polls');
if (!$table->hasColumn('show_results_to_participants')) {
$table->addColumn('show_results_to_participants', 'boolean', [
'null' => false,
'default' => true,
'after' => 'is_active',
])->update();
}
}
}