diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-05-15 18:55:33 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-05-15 18:59:36 -0700 |
commit | cd214b3ecde57c891537ff27edfde18b773dfe46 (patch) | |
tree | e2fde28d714a9599d71f8720a9d52c313dec2420 /rust/migrations | |
parent | 2b4d62b086802ece28f1288bd09cbf5f252c45d7 (diff) | |
download | fatcat-cd214b3ecde57c891537ff27edfde18b773dfe46.tar.gz fatcat-cd214b3ecde57c891537ff27edfde18b773dfe46.zip |
update schema
Diffstat (limited to 'rust/migrations')
-rw-r--r-- | rust/migrations/2018-05-12-001226_init/up.sql | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/rust/migrations/2018-05-12-001226_init/up.sql b/rust/migrations/2018-05-12-001226_init/up.sql index a517d788..0c62bc07 100644 --- a/rust/migrations/2018-05-12-001226_init/up.sql +++ b/rust/migrations/2018-05-12-001226_init/up.sql @@ -29,7 +29,7 @@ ALTER TABLE editor CREATE TABLE changelog ( id BIGSERIAL PRIMARY KEY, editgroup_id BIGINT REFERENCES editgroup(id) NOT NULL, - timestamp TIMESTAMP WITHOUT TIME ZONE DEFAULT now() + timestamp TIMESTAMP WITHOUT TIME ZONE DEFAULT now() NOT NULL ); -------------------- Creators ----------------------------------------------- @@ -37,7 +37,7 @@ CREATE TABLE creator_rev ( id BIGSERIAL PRIMARY KEY, extra_json JSONB, - name TEXT, + name TEXT NOT NULL, orcid TEXT ); @@ -66,7 +66,7 @@ CREATE TABLE container_rev ( id BIGSERIAL PRIMARY KEY, extra_json JSONB, - name TEXT, + name TEXT NOT NULL, parent_ident_id BIGINT REFERENCES container_rev(id), publisher TEXT, issn TEXT -- TODO: varchar @@ -119,11 +119,11 @@ CREATE TABLE release_rev ( id BIGSERIAL PRIMARY KEY, extra_json JSONB, - work_ident_id UUID, -- FOREIGN KEY; see ALRTER below + work_ident_id UUID NOT NULL, -- FOREIGN KEY; see ALRTER below container_ident_id UUID REFERENCES container_ident(id), - title TEXT, + title TEXT NOT NULL, license TEXT, -- TODO: ? - release_type TEXT, -- TODO: enum + release_type TEXT NOT NULL, -- TODO: enum date TEXT, -- XXX: datetime doi TEXT, -- TODO: identifier table? volume TEXT, @@ -189,11 +189,11 @@ CREATE TABLE release_contrib ( ); CREATE TABLE release_ref ( + id BIGSERIAL PRIMARY KEY, release_rev BIGSERIAL REFERENCES release_rev(id) NOT NULL, - target_release_ident_id UUID REFERENCES creator_ident(id), + target_release_ident_id UUID REFERENCES release_ident(id), -- or work? index INTEGER, stub TEXT - PRIMARY KEY (release_rev, target_release_ident_id) ); CREATE TABLE file_release ( |