aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-08-14 21:16:23 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-08-14 21:19:28 -0700
commit8136c7bdfb3f96b506001a083b4b92ebd15e083a (patch)
tree6e6fbcd42a8bed3b4a5d5912d7e5c0b929b3c281
parentede30fef3e572b142dfde3b77b9642ccee841587 (diff)
downloadfatcat-8136c7bdfb3f96b506001a083b4b92ebd15e083a.tar.gz
fatcat-8136c7bdfb3f96b506001a083b4b92ebd15e083a.zip
cockroach: try JSONB over JSON
-rw-r--r--rust/migrations/2018-05-12-001226_init/up.sql12
-rw-r--r--rust/src/database_schema.rs12
2 files changed, 12 insertions, 12 deletions
diff --git a/rust/migrations/2018-05-12-001226_init/up.sql b/rust/migrations/2018-05-12-001226_init/up.sql
index 542f8cca..113eea60 100644
--- a/rust/migrations/2018-05-12-001226_init/up.sql
+++ b/rust/migrations/2018-05-12-001226_init/up.sql
@@ -22,7 +22,7 @@ CREATE TABLE editgroup (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
editor_id UUID REFERENCES editor(id) NOT NULL,
created TIMESTAMP WITHOUT TIME ZONE DEFAULT now() NOT NULL,
- extra_json JSON,
+ extra_json JSONB,
description TEXT
);
@@ -47,7 +47,7 @@ CREATE TABLE abstracts (
-------------------- Creators -----------------------------------------------
CREATE TABLE creator_rev (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- extra_json JSON,
+ extra_json JSONB,
display_name TEXT NOT NULL,
given_name TEXT,
@@ -89,7 +89,7 @@ CREATE INDEX creator_edit_idx ON creator_edit(editgroup_id);
-------------------- Containers --------------------------------------------
CREATE TABLE container_rev (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- extra_json JSON,
+ extra_json JSONB,
name TEXT NOT NULL,
publisher TEXT,
@@ -127,7 +127,7 @@ CREATE INDEX container_edit_idx ON container_edit(editgroup_id);
-------------------- Files -------------------------------------------------
CREATE TABLE file_rev (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- extra_json JSON,
+ extra_json JSONB,
size BIGINT,
sha1 CHAR(40),
@@ -172,7 +172,7 @@ CREATE INDEX file_edit_idx ON file_edit(editgroup_id);
-------------------- Release -----------------------------------------------
CREATE TABLE release_rev (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- extra_json JSON,
+ extra_json JSONB,
work_ident_id UUID NOT NULL, -- FOREIGN KEY; see ALRTER below
container_ident_id UUID REFERENCES container_ident(id),
@@ -286,7 +286,7 @@ CREATE TABLE release_ref (
target_release_ident_id UUID REFERENCES release_ident(id), -- or work?
index_val BIGINT,
key TEXT,
- extra_json JSON, -- title, year, container_title, locator (aka, page), oci_id
+ extra_json JSONB, -- title, year, container_title, locator (aka, page), oci_id
container_title TEXT,
year BIGINT,
title TEXT,
diff --git a/rust/src/database_schema.rs b/rust/src/database_schema.rs
index a6605d81..98eb0961 100644
--- a/rust/src/database_schema.rs
+++ b/rust/src/database_schema.rs
@@ -38,7 +38,7 @@ table! {
table! {
container_rev (id) {
id -> Uuid,
- extra_json -> Nullable<Json>,
+ extra_json -> Nullable<Jsonb>,
name -> Text,
publisher -> Nullable<Text>,
issnl -> Nullable<Bpchar>,
@@ -73,7 +73,7 @@ table! {
table! {
creator_rev (id) {
id -> Uuid,
- extra_json -> Nullable<Json>,
+ extra_json -> Nullable<Jsonb>,
display_name -> Text,
given_name -> Nullable<Text>,
surname -> Nullable<Text>,
@@ -87,7 +87,7 @@ table! {
id -> Uuid,
editor_id -> Uuid,
created -> Timestamp,
- extra_json -> Nullable<Json>,
+ extra_json -> Nullable<Jsonb>,
description -> Nullable<Text>,
}
}
@@ -134,7 +134,7 @@ table! {
table! {
file_rev (id) {
id -> Uuid,
- extra_json -> Nullable<Json>,
+ extra_json -> Nullable<Jsonb>,
size -> Nullable<Int8>,
sha1 -> Nullable<Bpchar>,
sha256 -> Nullable<Bpchar>,
@@ -193,7 +193,7 @@ table! {
target_release_ident_id -> Nullable<Uuid>,
index_val -> Nullable<Int8>,
key -> Nullable<Text>,
- extra_json -> Nullable<Json>,
+ extra_json -> Nullable<Jsonb>,
container_title -> Nullable<Text>,
year -> Nullable<Int8>,
title -> Nullable<Text>,
@@ -204,7 +204,7 @@ table! {
table! {
release_rev (id) {
id -> Uuid,
- extra_json -> Nullable<Json>,
+ extra_json -> Nullable<Jsonb>,
work_ident_id -> Uuid,
container_ident_id -> Nullable<Uuid>,
title -> Text,