-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #274 from NEU-DSG/cm/contributor-audio-migrations
Database migrations for contributor audio and curation
- Loading branch information
Showing
5 changed files
with
86 additions
and
20 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
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,13 @@ | ||
# User | ||
|
||
## `dailp_user` | ||
|
||
Metadata assocated with a user. `dailp_user.id` on this table is equal to `sub` in | ||
AWS. Users are not to be confused with `contributor` entires, which are imported | ||
from Google Sheets. | ||
|
||
| column | type | description | | ||
| -------------- | ------ | -------------------------------------------------- | | ||
| `id` | `uuid` | Primary key, AWS Cognito `sub` claim | | ||
| `display_name` | `text` | How the user's name should be presented in the app | | ||
| `created_at` | `date` | When the user record was created | |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
-- Add migration script here | ||
|
||
create table dailp_user ( | ||
id autouuid primary key, | ||
display_name text not null, | ||
created_at date not null | ||
); | ||
|
||
alter table media_resource | ||
add column recorded_by uuid, | ||
add constraint recorded_by_fkey foreign key (recorded_by) references dailp_user (id) on delete set null; | ||
|
||
|
||
alter table word | ||
add column curated_audio_slice_id uuid, | ||
add constraint curated_audio_slice_id_fkey | ||
foreign key (curated_audio_slice_id) references media_slice (id) on delete set null, | ||
add column audio_curated_by uuid, | ||
add constraint audio_curated_by_fkey | ||
foreign key (audio_curated_by) references dailp_user (id) on delete set null; | ||
|
||
|
||
create table word_user_media ( | ||
word_id uuid not null references word (id) on delete cascade, | ||
media_slice_id uuid not null references media_slice (id) on delete cascade, | ||
primary key (word_id, media_slice_id) | ||
); |