aboutsummaryrefslogtreecommitdiffstats
path: root/rust/migrations/2018-05-12-001226_init/up.sql
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-24 22:35:37 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-24 22:35:37 -0700
commit2991a4349f86cca8d1dcc978e3506f3032d5ebdd (patch)
tree387d96b7d215115cae5f342525d2ba53e7fe6e74 /rust/migrations/2018-05-12-001226_init/up.sql
parentd91c04608480f819263dedc8eaa4ecf707e5914e (diff)
downloadfatcat-2991a4349f86cca8d1dcc978e3506f3032d5ebdd.tar.gz
fatcat-2991a4349f86cca8d1dcc978e3506f3032d5ebdd.zip
extra_json in SQL schema and implementation
Diffstat (limited to 'rust/migrations/2018-05-12-001226_init/up.sql')
-rw-r--r--rust/migrations/2018-05-12-001226_init/up.sql20
1 files changed, 10 insertions, 10 deletions
diff --git a/rust/migrations/2018-05-12-001226_init/up.sql b/rust/migrations/2018-05-12-001226_init/up.sql
index d8b93dc2..5d11191e 100644
--- a/rust/migrations/2018-05-12-001226_init/up.sql
+++ b/rust/migrations/2018-05-12-001226_init/up.sql
@@ -35,7 +35,7 @@ CREATE TABLE changelog (
-------------------- Creators -----------------------------------------------
CREATE TABLE creator_rev (
id BIGSERIAL PRIMARY KEY,
- -- extra_json JSON,
+ extra_json JSON,
name TEXT NOT NULL,
orcid TEXT
@@ -54,7 +54,7 @@ CREATE TABLE creator_ident (
CREATE TABLE creator_edit (
id BIGSERIAL PRIMARY KEY,
- -- extra_json JSON,
+ extra_json JSON,
ident_id UUID REFERENCES creator_ident(id) NOT NULL,
rev_id BIGINT REFERENCES creator_rev(id),
redirect_id UUID REFERENCES creator_ident(id),
@@ -64,7 +64,7 @@ CREATE TABLE creator_edit (
-------------------- Containers --------------------------------------------
CREATE TABLE container_rev (
id BIGSERIAL PRIMARY KEY,
- -- extra_json JSON,
+ extra_json JSON,
name TEXT NOT NULL,
publisher TEXT,
@@ -82,7 +82,7 @@ CREATE TABLE container_ident (
CREATE TABLE container_edit (
id BIGSERIAL PRIMARY KEY,
- -- extra_json JSON,
+ extra_json JSON,
ident_id UUID REFERENCES container_ident(id) NOT NULL,
rev_id BIGINT REFERENCES container_rev(id),
redirect_id UUID REFERENCES container_ident(id),
@@ -92,7 +92,7 @@ CREATE TABLE container_edit (
-------------------- Files -------------------------------------------------
CREATE TABLE file_rev (
id BIGSERIAL PRIMARY KEY,
- -- extra_json JSON,
+ extra_json JSON,
size BIGINT,
sha1 TEXT, -- TODO: varchar or bytes
@@ -108,7 +108,7 @@ CREATE TABLE file_ident (
CREATE TABLE file_edit (
id BIGSERIAL PRIMARY KEY,
- -- extra_json JSON,
+ extra_json JSON,
ident_id UUID REFERENCES file_ident(id) NOT NULL,
rev_id BIGINT REFERENCES file_rev(id),
redirect_id UUID REFERENCES file_ident(id),
@@ -118,7 +118,7 @@ CREATE TABLE file_edit (
-------------------- Release -----------------------------------------------
CREATE TABLE release_rev (
id BIGSERIAL PRIMARY KEY,
- -- extra_json JSON,
+ extra_json JSON,
work_ident_id UUID NOT NULL, -- FOREIGN KEY; see ALRTER below
container_ident_id UUID REFERENCES container_ident(id),
@@ -142,7 +142,7 @@ CREATE TABLE release_ident (
CREATE TABLE release_edit (
id BIGSERIAL PRIMARY KEY,
- -- extra_json JSON,
+ extra_json JSON,
ident_id UUID REFERENCES release_ident(id) NOT NULL,
rev_id BIGINT REFERENCES release_rev(id),
redirect_id UUID REFERENCES release_ident(id),
@@ -152,7 +152,7 @@ CREATE TABLE release_edit (
-------------------- Works --------------------------------------------------
CREATE TABLE work_rev (
id BIGSERIAL PRIMARY KEY,
- -- extra_json JSON,
+ extra_json JSON,
-- not even a work, for now
work_type TEXT, -- TODO: enum?
@@ -168,7 +168,7 @@ CREATE TABLE work_ident (
CREATE TABLE work_edit (
id BIGSERIAL PRIMARY KEY,
- -- extra_json JSON,
+ extra_json JSON,
ident_id UUID REFERENCES work_ident(id) NOT NULL,
rev_id BIGINT REFERENCES work_rev(id),
redirect_id UUID REFERENCES work_ident(id),