summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-15 18:11:28 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-15 18:11:28 -0700
commit3dad2832c8d481bff03fd4f2e6baa9f76ed0f588 (patch)
tree94e4b8c9b7b8d7572e1c11180630c9c1133182ea
parent2233970493bec6228046a75941a2e6a04500f924 (diff)
downloadfatcat-3dad2832c8d481bff03fd4f2e6baa9f76ed0f588.tar.gz
fatcat-3dad2832c8d481bff03fd4f2e6baa9f76ed0f588.zip
JSONB not JSON
-rw-r--r--rust/migrations/2018-05-12-001226_init/up.sql22
1 files changed, 11 insertions, 11 deletions
diff --git a/rust/migrations/2018-05-12-001226_init/up.sql b/rust/migrations/2018-05-12-001226_init/up.sql
index f4583949..7d236f80 100644
--- a/rust/migrations/2018-05-12-001226_init/up.sql
+++ b/rust/migrations/2018-05-12-001226_init/up.sql
@@ -17,7 +17,7 @@ CREATE TABLE editor (
CREATE TABLE editgroup (
id BIGSERIAL PRIMARY KEY,
- extra_json JSON,
+ extra_json JSONB,
editor_id BIGSERIAL REFERENCES editor(id) NOT NULL,
description TEXT
);
@@ -35,7 +35,7 @@ CREATE TABLE changelog (
-------------------- Creators -----------------------------------------------
CREATE TABLE creator_rev (
id BIGSERIAL PRIMARY KEY,
- extra_json JSON,
+ extra_json JSONB,
name TEXT,
orcid TEXT
@@ -54,7 +54,7 @@ CREATE TABLE creator_ident (
CREATE TABLE creator_edit (
id BIGSERIAL PRIMARY KEY,
- extra_json JSON,
+ extra_json JSONB,
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 JSONB,
name TEXT,
parent_ident_id BIGINT REFERENCES container_rev(id),
@@ -81,7 +81,7 @@ CREATE TABLE container_ident (
CREATE TABLE container_edit (
id BIGSERIAL PRIMARY KEY,
- extra_json JSON,
+ extra_json JSONB,
ident_id UUID REFERENCES container_ident(id) NOT NULL,
rev_id BIGINT REFERENCES container_rev(id),
redirect_id UUID REFERENCES container_ident(id),
@@ -91,7 +91,7 @@ CREATE TABLE container_edit (
-------------------- Files -------------------------------------------------
CREATE TABLE file_rev (
id BIGSERIAL PRIMARY KEY,
- extra_json JSON,
+ extra_json JSONB,
size INTEGER, -- TODO: uint64
sha1 TEXT, -- TODO: varchar or bytes
@@ -107,7 +107,7 @@ CREATE TABLE file_ident (
CREATE TABLE file_edit (
id BIGSERIAL PRIMARY KEY,
- extra_json JSON,
+ extra_json JSONB,
ident_id UUID REFERENCES file_ident(id) NOT NULL,
rev_id BIGINT REFERENCES file_rev(id),
redirect_id UUID REFERENCES file_ident(id),
@@ -117,7 +117,7 @@ CREATE TABLE file_edit (
-------------------- Release -----------------------------------------------
CREATE TABLE release_rev (
id BIGSERIAL PRIMARY KEY,
- extra_json JSON,
+ extra_json JSONB,
work_ident_id UUID, -- FOREIGN KEY; see ALRTER below
container_ident_id UUID REFERENCES container_ident(id),
@@ -140,7 +140,7 @@ CREATE TABLE release_ident (
CREATE TABLE release_edit (
id BIGSERIAL PRIMARY KEY,
- extra_json JSON,
+ extra_json JSONB,
ident_id UUID REFERENCES release_ident(id) NOT NULL,
rev_id BIGINT REFERENCES release_rev(id),
redirect_id UUID REFERENCES release_ident(id),
@@ -150,7 +150,7 @@ CREATE TABLE release_edit (
-------------------- Works --------------------------------------------------
CREATE TABLE work_rev (
id BIGSERIAL PRIMARY KEY,
- extra_json JSON,
+ extra_json JSONB,
-- not even a work, for now
work_type TEXT, -- TODO: enum?
@@ -166,7 +166,7 @@ CREATE TABLE work_ident (
CREATE TABLE work_edit (
id BIGSERIAL PRIMARY KEY,
- extra_json JSON,
+ extra_json JSONB,
ident_id UUID REFERENCES work_ident(id) NOT NULL,
rev_id BIGINT REFERENCES work_rev(id),
redirect_id UUID REFERENCES work_ident(id),