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>
38 lines
900 B
PHP
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();
|
|
}
|
|
}
|
|
}
|