Files
Plenario/config/Migrations/20261111120000_AddCommentSpeedToPolls.php
gnilebeinandClaude Opus 5.5 166cb475c6
CI / Deploy / test (push) Successful in 1m12s
CI / Deploy / deploy (push) Skipped
Let each poll speed up or slow down the scale comments
A new poll setting (polls.comment_speed, 50-200 %) scales the display
time of the rotating scale comments in the presentation and embed; the
duration still follows the text length.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 12:51:08 +01:00

38 lines
900 B
PHP

<?php
declare(strict_types=1);
use Migrations\BaseMigration;
/**
* Speed of the rotating scale comments in the presentation, per poll in percent
* (100 = normal, below = slower, above = faster), see Poll::COMMENT_SPEEDS.
*/
class AddCommentSpeedToPolls extends BaseMigration
{
/**
* @return void
*/
public function up(): void
{
$table = $this->table('polls');
if (!$table->hasColumn('comment_speed')) {
$table->addColumn('comment_speed', 'integer', [
'null' => false,
'default' => 100,
'after' => 'is_active',
])->update();
}
}
/**
* @return void
*/
public function down(): void
{
$table = $this->table('polls');
if ($table->hasColumn('comment_speed')) {
$table->removeColumn('comment_speed')->update();
}
}
}