Files
Plenario/config/Migrations/20261121120000_AddAudioToPolls.php
T
gnilebeinandClaude Sonnet 5.5 2f7a401522
CI / Deploy / PHP 8.4 (push) Failing after 1m18s
CI / Deploy / PHP 8.5 (push) Failing after 2m4s
CI / Deploy / test (push) Failing after 1s
CI / Deploy / deploy (push) Skipped
Add countdown audio per presentation
One audio file per poll (MP3, M4A, OGG, WAV) is uploaded in the admin
settings and looped in the presenter view while a quiz runs. Format is
detected by magic bytes, files are served with a fixed content type,
copied with the poll and swept by images_cleanup.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-21 11:36:01 +01:00

35 lines
849 B
PHP

<?php
declare(strict_types=1);
use Migrations\BaseMigration;
/**
* Optional audio file per presentation, played in the presenter view while a quiz countdown runs.
* The file lives in the upload directory, see \App\Service\AudioService; the table only holds its
* random file name.
*/
class AddAudioToPolls extends BaseMigration
{
/**
* @return void
*/
public function up(): void
{
$table = $this->table('polls');
if (!$table->hasColumn('audio')) {
$table->addColumn('audio', 'string', ['null' => true, 'default' => null, 'limit' => 40])->update();
}
}
/**
* @return void
*/
public function down(): void
{
$table = $this->table('polls');
if ($table->hasColumn('audio')) {
$table->removeColumn('audio')->update();
}
}
}