-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate sql schema for contributed/edited audio on documents (#433)
- Loading branch information
1 parent
3242f43
commit 2a6505e
Showing
3 changed files
with
48 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
types/migrations/20241113142347_add_document_user_audio.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-- Create tables and columns needed to have user contributed audio for a whole document | ||
|
||
-- add columns for "editing" (hiding/showing) audio ingested from recording sessions | ||
alter table document | ||
add column include_audio_in_edited_collection boolean not null DEFAULT true, | ||
add column audio_edited_by uuid, | ||
add constraint audio_edited_by_fkey | ||
foreign key (audio_edited_by) | ||
references dailp_user (id) | ||
on delete set null; | ||
|
||
-- create a join table for user contributed audio slices | ||
create table document_user_media ( | ||
document_id uuid not null references document (id) on delete cascade, | ||
media_slice_id uuid not null references media_slice (id) on delete cascade, | ||
include_in_edited_collection boolean not null DEFAULT false, | ||
edited_by uuid references dailp_user (id) on delete set null, | ||
primary key (document_id, media_slice_id) | ||
); |