aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--notes/cockroach_tuning.md96
-rw-r--r--rust/README.cockroach.md24
-rw-r--r--rust/migrations/00000000000000_diesel_initial_setup/down.sql5
-rw-r--r--rust/migrations/00000000000000_diesel_initial_setup/up.sql36
-rw-r--r--rust/migrations/2018-05-12-001226_init/down.sql2
-rw-r--r--rust/migrations/2018-05-12-001226_init/up.sql63
-rw-r--r--rust/src/api_entity_crud.rs20
-rw-r--r--rust/src/database_schema.rs26
-rw-r--r--rust/src/lib.rs6
-rw-r--r--rust/tests/test_api_server.rs2
10 files changed, 203 insertions, 77 deletions
diff --git a/notes/cockroach_tuning.md b/notes/cockroach_tuning.md
new file mode 100644
index 00000000..dc6acb4f
--- /dev/null
+++ b/notes/cockroach_tuning.md
@@ -0,0 +1,96 @@
+
+When doing a bulk import, could try:
+
+
+Probably want to set:
+
+ --cache=.25 --max-sql-memory=.25
+
+Check FD limits:
+
+ cat /proc/sys/fs/file-max
+ ulimit -a
+
+Set with:
+
+ echo 150000 > /proc/sys/fs/file-max
+
+TODO:
+- set `num_replicas=1` when testing
+- close browser to free up RAM
+- disable raft fsync
+ https://github.com/cockroachdb/cockroach/issues/19784
+- increase import batch size (10x current)
+
+## Log of Tests
+
+build: CCL v2.0.5 @ 2018/08/13 17:59:42 (go1.10)
+
+COCKROACH branch e386022ba051f46ff70c28b90d9a2fe1f856c57f
+
+cockroach start --insecure --store=fatcat-dev --host=localhost
+
+ time ./fatcat_import.py import-issn /home/bnewbold/code/oa-journals-analysis/upload-2018-04-05/journal_extra_metadata.csv
+
+ real 3m20.781s
+ user 0m6.900s
+ sys 0m0.336s
+
+ cat /data/crossref/crossref-works.2018-01-21.badsample_100k.json | time parallel -j4 --round-robin --pipe ./fatcat_import.py import-crossref - /data/issn/20180216.ISSN-to-ISSN-L.txt
+
+ => gave up after ~30 minutes with only ~40% done
+
+With cockroach, container lookups seem to be particularly slow, like 1000ms+,
+though not reflected in cockroach-reported stats . Very high CPU usage by
+cockroach.
+
+Cockroach is self-reporting P50 latency: 0.3 ms, P99 latency: 104.9 ms
+
+Seeing lots of Queue Processing Failures, of the "replication" type. Probably because there are no other nodes.
+
+CHANGES:
+- closed browser, restarted postgres, restarted fatcatd to free up RAM
+- cockroach start --insecure --store=fatcat-dev --host=localhost --cache=.25 --max-sql-memory=.25
+- cockroach zone set --insecure .default -f -
+ num_replicas: 1
+ ^D
+- SET CLUSTER SETTING kv.raft_log.synchronize=false;
+- batch size from default (50) to 500
+
+ time ./fatcat_import.py import-issn --batch-size 500 /home/bnewbold/code/oa-journals-analysis/upload-2018-04-05/journal_extra_metadata.csv
+
+ real 1m10.531s
+ user 0m5.204s
+ sys 0m0.128s
+
+Have 12 SQL connections
+
+ cat /data/crossref/crossref-works.2018-01-21.badsample_100k.json | time parallel -j4 --round-robin --pipe ./fatcat_import.py import-crossref --batch-size 500 - /data/issn/20180216.ISSN-to-ISSN-L.txt
+
+ GETs are still very slow end-to-end (~1sec)
+ during this time, though, cockroach is quoting very low latency
+ => halted
+
+It's the join performance (on lookups) that is killing things for release rev import:
+
+ select * from container_rev where issnl = '0010-7824';
+ Time: 2.16272ms
+
+ select * from container_rev inner join container_ident on container_rev.id = container_ident.rev_id where issnl = '0010-7824';
+ Time: 147.44647ms
+
+CHANGED: CCL v2.1.0-beta.20180904 @ 2018/09/04 03:51:03 (go1.10.3)
+
+ time ./fatcat_import.py import-issn --batch-size 500 /home/bnewbold/code/oa-journals-analysis/upload-2018-04-05/journal_extra_metadata.csv
+
+ real 0m59.903s
+ user 0m4.716s
+ sys 0m0.076s
+
+ cat /data/crossref/crossref-works.2018-01-21.badsample_100k.json | time parallel -j4 --round-robin --pipe ./fatcat_import.py import-crossref --batch-size 500 - /data/issn/20180216.ISSN-to-ISSN-L.txt
+
+ => still extremely slow API latency, though cockroach is reporting very
+ fast (P50 latency 1.0 ms, P99 latency 4.7 ms)
+ => maybe a timeout or something going on?
+ => single-level joins from CLI are ~200 ms
+
diff --git a/rust/README.cockroach.md b/rust/README.cockroach.md
new file mode 100644
index 00000000..e42d8c4b
--- /dev/null
+++ b/rust/README.cockroach.md
@@ -0,0 +1,24 @@
+
+Setup a user and database on a local, single-host node:
+
+ # using v2.0.5 (2018/08/13)
+ cockroach start --insecure --store=fatcat-dev --host=localhost
+ cockroach user set maxroach --insecure
+ cockroach sql --insecure -e 'CREATE DATABASE fatcat'
+ cockroach sql --insecure -e 'GRANT ALL ON DATABASE fatcat TO maxroach'
+ cockroach sql --insecure -e 'CREATE DATABASE fatcat_test'
+ cockroach sql --insecure -e 'GRANT ALL ON DATABASE fatcat_test TO maxroach'
+
+Create a .env file:
+
+ DATABASE_URL=postgres://maxroach@localhost:26257/fatcat
+ TEST_DATABASE_URL=postgres://maxroach@localhost:26257/fatcat_test
+ RUST_TEST_THREADS=1
+
+Create:
+
+ cockroach sql --insecure -d fatcat < migrations/2018-05-12-001226_init/down.sql
+ cockroach sql --insecure -d fatcat < migrations/2018-05-12-001226_init/up.sql
+
+ cockroach sql --insecure -d fatcat_test < migrations/2018-05-12-001226_init/down.sql
+ cockroach sql --insecure -d fatcat_test < migrations/2018-05-12-001226_init/up.sql
diff --git a/rust/migrations/00000000000000_diesel_initial_setup/down.sql b/rust/migrations/00000000000000_diesel_initial_setup/down.sql
index a9f52609..adfa4902 100644
--- a/rust/migrations/00000000000000_diesel_initial_setup/down.sql
+++ b/rust/migrations/00000000000000_diesel_initial_setup/down.sql
@@ -2,5 +2,6 @@
-- and other internal bookkeeping. This file is safe to edit, any future
-- changes will be added to existing projects as new migrations.
-DROP FUNCTION IF EXISTS diesel_manage_updated_at(_tbl regclass);
-DROP FUNCTION IF EXISTS diesel_set_updated_at();
+SELECT 1;
+-- DROP FUNCTION IF EXISTS diesel_manage_updated_at(_tbl regclass);
+-- DROP FUNCTION IF EXISTS diesel_set_updated_at();
diff --git a/rust/migrations/00000000000000_diesel_initial_setup/up.sql b/rust/migrations/00000000000000_diesel_initial_setup/up.sql
index 3400c7c5..f89156f7 100644
--- a/rust/migrations/00000000000000_diesel_initial_setup/up.sql
+++ b/rust/migrations/00000000000000_diesel_initial_setup/up.sql
@@ -16,22 +16,24 @@
--
-- SELECT diesel_manage_updated_at('users');
-- ```
-CREATE OR REPLACE FUNCTION diesel_manage_updated_at(_tbl regclass) RETURNS VOID AS $$
-BEGIN
- EXECUTE format('CREATE TRIGGER set_updated_at BEFORE UPDATE ON %s
- FOR EACH ROW EXECUTE PROCEDURE diesel_set_updated_at()', _tbl);
-END;
-$$ LANGUAGE plpgsql;
-CREATE OR REPLACE FUNCTION diesel_set_updated_at() RETURNS trigger AS $$
-BEGIN
- IF (
- NEW IS DISTINCT FROM OLD AND
- NEW.updated_at IS NOT DISTINCT FROM OLD.updated_at
- ) THEN
- NEW.updated_at := current_timestamp;
- END IF;
- RETURN NEW;
-END;
-$$ LANGUAGE plpgsql;
+-- CREATE OR REPLACE FUNCTION diesel_manage_updated_at(_tbl regclass) RETURNS VOID AS $$
+-- BEGIN
+-- EXECUTE format('CREATE TRIGGER set_updated_at BEFORE UPDATE ON %s
+-- FOR EACH ROW EXECUTE PROCEDURE diesel_set_updated_at()', _tbl);
+-- END;
+-- $$ LANGUAGE plpgsql;
+-- CREATE OR REPLACE FUNCTION diesel_set_updated_at() RETURNS trigger AS $$
+-- BEGIN
+-- IF (
+-- NEW IS DISTINCT FROM OLD AND
+-- NEW.updated_at IS NOT DISTINCT FROM OLD.updated_at
+-- ) THEN
+-- NEW.updated_at := current_timestamp;
+-- END IF;
+-- RETURN NEW;
+-- END;
+-- $$ LANGUAGE plpgsql;
+
+SELECT 1
diff --git a/rust/migrations/2018-05-12-001226_init/down.sql b/rust/migrations/2018-05-12-001226_init/down.sql
index 3f796db6..7667d122 100644
--- a/rust/migrations/2018-05-12-001226_init/down.sql
+++ b/rust/migrations/2018-05-12-001226_init/down.sql
@@ -31,3 +31,5 @@ DROP TABLE IF EXISTS abstracts CASCADE;
DROP TABLE IF EXISTS editor CASCADE;
DROP TABLE IF EXISTS editgroup CASCADE;
DROP TABLE IF EXISTS changelog CASCADE;
+
+DROP SEQUENCE IF EXISTS changelog_seq CASCADE;
diff --git a/rust/migrations/2018-05-12-001226_init/up.sql b/rust/migrations/2018-05-12-001226_init/up.sql
index c21e5b5e..bb62ba75 100644
--- a/rust/migrations/2018-05-12-001226_init/up.sql
+++ b/rust/migrations/2018-05-12-001226_init/up.sql
@@ -1,26 +1,28 @@
-- written for Postgres 9.6 with OSSP extension for UUIDs -- ... but actually runs on Postgres 10 in qa/production
-CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
+-- CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
-- uuid_generate_v1mc: timestamp ordered, random MAC address
--- uuid_generate_v4: totally random
+-- gen_random_uuid: totally random
-- NB: could use LIKE clause, or "composite types"
CREATE TABLE editor (
- id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
username TEXT NOT NULL UNIQUE,
is_admin BOOLEAN NOT NULL DEFAULT false,
registered TIMESTAMP WITHOUT TIME ZONE DEFAULT now() NOT NULL,
active_editgroup_id UUID -- REFERENCES( editgroup(id) via ALTER below
);
+CREATE INDEX active_editgroup_idx ON editor(active_editgroup_id);
+
CREATE TABLE editgroup (
- id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
+ 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
);
@@ -28,8 +30,10 @@ ALTER TABLE editor
ADD CONSTRAINT editor_editgroupid_fkey FOREIGN KEY (active_editgroup_id)
REFERENCES editgroup(id);
+CREATE SEQUENCE changelog_seq START 1 INCREMENT 1;
+
CREATE TABLE changelog (
- id BIGSERIAL PRIMARY KEY,
+ id BIGINT PRIMARY KEY DEFAULT nextval('changelog_seq'),
editgroup_id UUID REFERENCES editgroup(id) NOT NULL,
timestamp TIMESTAMP WITHOUT TIME ZONE DEFAULT now() NOT NULL
);
@@ -44,8 +48,8 @@ CREATE TABLE abstracts (
-------------------- Creators -----------------------------------------------
CREATE TABLE creator_rev (
- id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
- extra_json JSON,
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
+ extra_json JSONB,
display_name TEXT NOT NULL,
given_name TEXT,
@@ -63,7 +67,7 @@ CREATE INDEX creator_rev_orcid_idx ON creator_rev(orcid);
CREATE INDEX creator_rev_wikidata_idx ON creator_rev(wikidata_qid);
CREATE TABLE creator_ident (
- id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
is_live BOOL NOT NULL DEFAULT false,
rev_id UUID REFERENCES creator_rev(id),
redirect_id UUID REFERENCES creator_ident(id)
@@ -79,15 +83,15 @@ CREATE TABLE creator_edit (
rev_id UUID REFERENCES creator_rev(id),
redirect_id UUID REFERENCES creator_ident(id),
prev_rev UUID REFERENCES creator_rev(id),
- extra_json JSON
+ extra_json JSONB
);
CREATE INDEX creator_edit_idx ON creator_edit(editgroup_id);
-------------------- Containers --------------------------------------------
CREATE TABLE container_rev (
- id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
- extra_json JSON,
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
+ extra_json JSONB,
name TEXT NOT NULL,
publisher TEXT,
@@ -101,7 +105,7 @@ CREATE INDEX container_rev_issnl_idx ON container_rev(issnl);
CREATE INDEX container_rev_wikidata_idx ON container_rev(wikidata_qid);
CREATE TABLE container_ident (
- id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
is_live BOOL NOT NULL DEFAULT false,
rev_id UUID REFERENCES container_rev(id),
redirect_id UUID REFERENCES container_ident(id)
@@ -117,15 +121,15 @@ CREATE TABLE container_edit (
rev_id UUID REFERENCES container_rev(id),
redirect_id UUID REFERENCES container_ident(id),
prev_rev UUID REFERENCES container_rev(id),
- extra_json JSON
+ extra_json JSONB
);
CREATE INDEX container_edit_idx ON container_edit(editgroup_id);
-------------------- Files -------------------------------------------------
CREATE TABLE file_rev (
- id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
- extra_json JSON,
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
+ extra_json JSONB,
size BIGINT,
sha1 CHAR(40),
@@ -148,7 +152,7 @@ CREATE TABLE file_rev_url (
CREATE INDEX file_rev_url_rev_idx ON file_rev_url(file_rev);
CREATE TABLE file_ident (
- id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
is_live BOOL NOT NULL DEFAULT false,
rev_id UUID REFERENCES file_rev(id),
redirect_id UUID REFERENCES file_ident(id)
@@ -164,15 +168,15 @@ CREATE TABLE file_edit (
rev_id UUID REFERENCES file_rev(id),
redirect_id UUID REFERENCES file_ident(id),
prev_rev UUID REFERENCES file_rev(id),
- extra_json JSON
+ extra_json JSONB
);
CREATE INDEX file_edit_idx ON file_edit(editgroup_id);
-------------------- Release -----------------------------------------------
CREATE TABLE release_rev (
- id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
- extra_json JSON,
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
+ extra_json JSONB,
work_ident_id UUID NOT NULL, -- FOREIGN KEY; see ALRTER below
container_ident_id UUID REFERENCES container_ident(id),
@@ -211,11 +215,8 @@ CREATE TABLE release_rev_abstract (
lang TEXT
);
-CREATE INDEX release_rev_abstract_rev_idx ON release_rev_abstract(release_rev);
-CREATE INDEX release_rev_abstract_sha1_idx ON release_rev_abstract(abstract_sha1);
-
CREATE TABLE release_ident (
- id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
is_live BOOL NOT NULL DEFAULT false,
rev_id UUID REFERENCES release_rev(id),
redirect_id UUID REFERENCES release_ident(id)
@@ -231,19 +232,19 @@ CREATE TABLE release_edit (
rev_id UUID REFERENCES release_rev(id),
redirect_id UUID REFERENCES release_ident(id),
prev_rev UUID REFERENCES release_rev(id),
- extra_json JSON
+ extra_json JSONB
);
CREATE INDEX release_edit_idx ON release_edit(editgroup_id);
-------------------- Works --------------------------------------------------
CREATE TABLE work_rev (
- id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
- extra_json JSON
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
+ extra_json JSONB
);
CREATE TABLE work_ident (
- id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
is_live BOOL NOT NULL DEFAULT false,
rev_id UUID REFERENCES work_rev(id),
redirect_id UUID REFERENCES work_ident(id)
@@ -259,7 +260,7 @@ CREATE TABLE work_edit (
rev_id UUID REFERENCES work_rev(id),
redirect_id UUID REFERENCES work_ident(id),
prev_rev UUID REFERENCES work_rev(id),
- extra_json JSON
+ extra_json JSONB
);
CREATE INDEX work_edit_idx ON work_edit(editgroup_id);
@@ -277,7 +278,7 @@ CREATE TABLE release_contrib (
raw_name TEXT,
role TEXT, -- TODO: enum?
index_val BIGINT,
- extra_json JSON
+ extra_json JSONB
);
CREATE INDEX release_contrib_rev_idx ON release_contrib(release_rev);
@@ -289,7 +290,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/api_entity_crud.rs b/rust/src/api_entity_crud.rs
index dd0961d5..2d5ea93d 100644
--- a/rust/src/api_entity_crud.rs
+++ b/rust/src/api_entity_crud.rs
@@ -391,8 +391,8 @@ impl EntityCrud for ContainerEntity {
generic_db_update!(container_ident, container_edit);
generic_db_delete!(container_ident, container_edit);
generic_db_get_history!(container_edit);
- generic_db_accept_edits_batch!("container");
- //generic_db_accept_edits_each!(container_ident, container_edit);
+ //generic_db_accept_edits_batch!("container");
+ generic_db_accept_edits_each!(container_ident, container_edit);
generic_db_insert_rev!();
fn db_from_row(
@@ -472,8 +472,8 @@ impl EntityCrud for CreatorEntity {
generic_db_update!(creator_ident, creator_edit);
generic_db_delete!(creator_ident, creator_edit);
generic_db_get_history!(creator_edit);
- generic_db_accept_edits_batch!("creator");
- //generic_db_accept_edits_each!(creator_ident, creator_edit);
+ //generic_db_accept_edits_batch!("creator");
+ generic_db_accept_edits_each!(creator_ident, creator_edit);
generic_db_insert_rev!();
fn db_from_row(
@@ -550,8 +550,8 @@ impl EntityCrud for FileEntity {
generic_db_update!(file_ident, file_edit);
generic_db_delete!(file_ident, file_edit);
generic_db_get_history!(file_edit);
- generic_db_accept_edits_batch!("file");
- //generic_db_accept_edits_each!(file_ident, file_edit);
+ //generic_db_accept_edits_batch!("file");
+ generic_db_accept_edits_each!(file_ident, file_edit);
generic_db_insert_rev!();
fn db_from_row(
@@ -688,8 +688,8 @@ impl EntityCrud for ReleaseEntity {
generic_db_update!(release_ident, release_edit);
generic_db_delete!(release_ident, release_edit);
generic_db_get_history!(release_edit);
- generic_db_accept_edits_batch!("release");
- //generic_db_accept_edits_each!(release_ident, release_edit);
+ //generic_db_accept_edits_batch!("release");
+ generic_db_accept_edits_each!(release_ident, release_edit);
generic_db_insert_rev!();
fn db_create(&self, conn: &DbConn, edit_context: &EditContext) -> Result<Self::EditRow> {
@@ -1062,8 +1062,8 @@ impl EntityCrud for WorkEntity {
generic_db_update!(work_ident, work_edit);
generic_db_delete!(work_ident, work_edit);
generic_db_get_history!(work_edit);
- generic_db_accept_edits_batch!("work");
- //generic_db_accept_edits_each!(work_ident, work_edit);
+ //generic_db_accept_edits_batch!("work");
+ generic_db_accept_edits_each!(work_ident, work_edit);
generic_db_insert_rev!();
fn db_from_row(
diff --git a/rust/src/database_schema.rs b/rust/src/database_schema.rs
index a6605d81..bc3f6c3a 100644
--- a/rust/src/database_schema.rs
+++ b/rust/src/database_schema.rs
@@ -22,7 +22,7 @@ table! {
rev_id -> Nullable<Uuid>,
redirect_id -> Nullable<Uuid>,
prev_rev -> Nullable<Uuid>,
- extra_json -> Nullable<Json>,
+ extra_json -> Nullable<Jsonb>,
}
}
@@ -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>,
@@ -57,7 +57,7 @@ table! {
rev_id -> Nullable<Uuid>,
redirect_id -> Nullable<Uuid>,
prev_rev -> Nullable<Uuid>,
- extra_json -> Nullable<Json>,
+ extra_json -> Nullable<Jsonb>,
}
}
@@ -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>,
}
}
@@ -111,7 +111,7 @@ table! {
rev_id -> Nullable<Uuid>,
redirect_id -> Nullable<Uuid>,
prev_rev -> Nullable<Uuid>,
- extra_json -> Nullable<Json>,
+ extra_json -> Nullable<Jsonb>,
}
}
@@ -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>,
@@ -160,7 +160,7 @@ table! {
raw_name -> Nullable<Text>,
role -> Nullable<Text>,
index_val -> Nullable<Int8>,
- extra_json -> Nullable<Json>,
+ extra_json -> Nullable<Jsonb>,
}
}
@@ -173,7 +173,7 @@ table! {
rev_id -> Nullable<Uuid>,
redirect_id -> Nullable<Uuid>,
prev_rev -> Nullable<Uuid>,
- extra_json -> Nullable<Json>,
+ extra_json -> Nullable<Jsonb>,
}
}
@@ -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,
@@ -244,7 +244,7 @@ table! {
rev_id -> Nullable<Uuid>,
redirect_id -> Nullable<Uuid>,
prev_rev -> Nullable<Uuid>,
- extra_json -> Nullable<Json>,
+ extra_json -> Nullable<Jsonb>,
}
}
@@ -260,7 +260,7 @@ table! {
table! {
work_rev (id) {
id -> Uuid,
- extra_json -> Nullable<Json>,
+ extra_json -> Nullable<Jsonb>,
}
}
diff --git a/rust/src/lib.rs b/rust/src/lib.rs
index 57cc535c..b4b9e3c7 100644
--- a/rust/src/lib.rs
+++ b/rust/src/lib.rs
@@ -103,9 +103,9 @@ pub fn test_server() -> Result<api_server::Server> {
let conn = server.db_pool.get().expect("db_pool error");
// run migrations; revert latest (dummy data); re-run latest
- diesel_migrations::run_pending_migrations(&conn).unwrap();
- diesel_migrations::revert_latest_migration(&conn).unwrap();
- diesel_migrations::run_pending_migrations(&conn).unwrap();
+ //diesel_migrations::run_pending_migrations(&conn).unwrap();
+ //diesel_migrations::revert_latest_migration(&conn).unwrap();
+ //diesel_migrations::run_pending_migrations(&conn).unwrap();
Ok(server)
}
diff --git a/rust/tests/test_api_server.rs b/rust/tests/test_api_server.rs
index 54639228..d10251f0 100644
--- a/rust/tests/test_api_server.rs
+++ b/rust/tests/test_api_server.rs
@@ -950,7 +950,7 @@ fn test_contribs() {
"http://localhost:9411/v0/release",
headers.clone(),
r#"{"title": "some paper",
- "doi": "10.1234/iiiiiii",
+ "doi": "10.1234/kkkkkkk",
"contribs": [{
"index": 1,
"raw_name": "textual description of contributor (aka, name)",