Skip to content
This repository
tree: 8dec4d28b6
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 43 lines (36 sloc) 1.525 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
--
-- Schema for sponsors table
--

CREATE TABLE sponsors (
       id TEXT PRIMARY KEY,
       description TEXT DEFAULT ''
);
GRANT SELECT ON sponsors TO "[% ro_role %]";
GRANT SELECT, INSERT, UPDATE, DELETE ON sponsors TO "[% rw_role %]";

-- XXX at the very least, need unique key on mutation_type, targeting_type, cassette_function
-- Should we dispense with the SERIAL id column on these tables?

CREATE TABLE mutation_types (
       id SERIAL PRIMARY KEY,
       mutation_type TEXT NOT NULL
);
GRANT SELECT ON mutation_types TO "[% ro_role %]";
GRANT SELECT, INSERT, UPDATE, DELETE ON mutation_types TO "[% rw_role %]";

CREATE TABLE targeting_types (
       id SERIAL PRIMARY KEY,
       targeting_type TEXT NOT NULL
);
GRANT SELECT ON targeting_types TO "[% ro_role %]";
GRANT SELECT, INSERT, UPDATE, DELETE ON targeting_types TO "[% rw_role %]";

CREATE TABLE cassette_functions (
       id SERIAL PRIMARY KEY,
       cassette_function TEXT NOT NULL
);
GRANT SELECT ON cassette_functions TO "[% ro_role %]";
GRANT SELECT, INSERT, UPDATE, DELETE ON cassette_functions TO "[% rw_role %]";

CREATE TABLE cassette_cassette_functions (
       cassette_id INTEGER NOT NULL REFERENCES cassettes(id),
       function_id INTEGER NOT NULL REFERENCES cassette_functions(id),
       PRIMARY KEY(cassette_id,function_id)
);
GRANT SELECT ON cassette_cassette_functions TO "[% ro_role %]";
GRANT SELECT, INSERT, UPDATE, DELETE ON cassette_cassette_functions TO "[% rw_role %]";
Something went wrong with that request. Please try again.