audio_recordings.pm: active audio uploads

If audio files become inactive because a new file is uploaded, the new
file is marked as active and the old file is marked as not active.
This allows fastly querying events and their active upload file.
Before this change all event's audio files were found and needed to be
filtered afterwards to get a set of unique events.
This commit is contained in:
Milan
2020-12-19 22:01:26 +01:00
parent 78f9f3c538
commit e3c3991db6
4 changed files with 81 additions and 34 deletions

View File

@@ -270,3 +270,10 @@ ADD COLUMN `update_event_field_content_format` TINYINT(1) UNSIGNED NOT NULL AFTE
ALTER TABLE `calcms_events`
ADD COLUMN `listen_key` VARCHAR(100) NULL;
ALTER TABLE `calcms_audio_recordings`
ADD COLUMN `active` TINYINT(1) NOT NULL DEFAULT 0 AFTER `event_id`;
ALTER TABLE `calcms`.`calcms_audio_recordings`
ADD INDEX `active_index` (`active`);