aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2019-08-26 14:13:13 +0200
committerBryan Newbold <bnewbold@archive.org>2019-08-26 14:13:13 +0200
commit5cf94a887d8edbeb811ea440c6b8eef90e34f7a2 (patch)
treeb572d0d1064f108935d3271b21adb25d06d7580a
parent952457f9fae1cc25cdeeefc00e19ae20cf86c659 (diff)
downloadsandcrawler-5cf94a887d8edbeb811ea440c6b8eef90e34f7a2.tar.gz
sandcrawler-5cf94a887d8edbeb811ea440c6b8eef90e34f7a2.zip
update shadow sandcrawler schema
-rw-r--r--postgrest/sandcrawler_schema.sql7
1 files changed, 4 insertions, 3 deletions
diff --git a/postgrest/sandcrawler_schema.sql b/postgrest/sandcrawler_schema.sql
index 7460cdc..fd921ed 100644
--- a/postgrest/sandcrawler_schema.sql
+++ b/postgrest/sandcrawler_schema.sql
@@ -48,11 +48,12 @@ CREATE TABLE IF NOT EXISTS grobid (
-- CREATE INDEX grobid_fatcat_release_idx ON grobid(fatcat_release);
CREATE TABLE IF NOT EXISTS shadow (
- sha1hex TEXT NOT NULL CHECK (octet_length(sha1hex) = 40),
shadow_corpus TEXT NOT NULL CHECK (octet_length(shadow_corpus) >= 1),
- shadow_id TEXT CHECK (octet_length(shadow_id) >= 1),
+ shadow_id TEXT NOT NULL CHECK (octet_length(shadow_id) >= 1),
+ sha1hex TEXT NOT NULL CHECK (octet_length(sha1hex) = 40),
doi TEXT CHECK (octet_length(doi) >= 1),
pmid TEXT CHECK (octet_length(pmid) >= 1),
isbn13 TEXT CHECK (octet_length(isbn13) >= 1),
- PRIMARY KEY(sha1hex, shadow_corpus)
+ PRIMARY KEY(shadow_corpus, shadow_id)
);
+CREATE INDEX shadow_sha1hex_idx ON shadow(sha1hex);