Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EASI-4527] add presentation links schema #2951

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions migrations/V198__Add_async_GRB_presentation_links.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
CREATE TABLE IF NOT EXISTS system_intake_grb_presentation_links (
id UUID PRIMARY KEY NOT NULL,
created_by UUID NOT NULL REFERENCES user_account(id),
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,
modified_by UUID REFERENCES user_account(id),
modified_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
system_intake_id UUID NOT NULL UNIQUE REFERENCES system_intakes(id),
recording_link TEXT,
recording_passcode TEXT,
bucket_name TEXT,
samoddball marked this conversation as resolved.
Show resolved Hide resolved
transcript_link TEXT,
transcript_s3_key TEXT,
transcript_file_name TEXT,
presentation_deck_s3_key TEXT,
presentation_deck_file_name TEXT,
CONSTRAINT transcript_link_or_doc_null_check CHECK (
(
transcript_link IS NULL AND
transcript_s3_key IS NULL AND
transcript_file_name IS NULL
) OR
(
transcript_link IS NOT NULL AND
transcript_s3_key IS NULL AND
transcript_file_name IS NULL
) OR
(
transcript_link IS NULL AND
transcript_s3_key IS NOT NULL AND
transcript_file_name IS NOT NULL
)
),
CONSTRAINT presentation_deck_null_check CHECK (
(
presentation_deck_s3_key IS NULL AND
presentation_deck_file_name IS NULL
) OR
(
presentation_deck_s3_key IS NOT NULL AND
presentation_deck_file_name IS NOT NULL
)
),
CONSTRAINT bucket_name_null_check CHECK (
(
bucket_name IS NULL AND
presentation_deck_s3_key IS NULL AND
transcript_s3_key IS NULL
) OR
(
(
presentation_deck_s3_key IS NOT NULL OR
transcript_s3_key IS NOT NULL
) AND
bucket_name IS NOT NULL
)
)
);

COMMENT ON CONSTRAINT transcript_link_or_doc_null_check ON system_intake_grb_presentation_links IS 'Ensures either a transcript link OR document is inserted and that the file name and s3 key are present if transcript is a document';

COMMENT ON CONSTRAINT presentation_deck_null_check ON system_intake_grb_presentation_links IS 'Ensures presentation deck file name and s3 key are both present or both null';

COMMENT ON CONSTRAINT bucket_name_null_check ON system_intake_grb_presentation_links IS 'Ensures bucket name is present if s3 keys for either presentation deck or transcript are present';
Loading
Loading