summaryrefslogtreecommitdiffstats
path: root/rust/migrations/2018-05-12-001226_init/up.sql
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-09-17 13:56:36 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-09-17 13:56:36 -0700
commit8baa2d8808797e423829fb040d70206d24b6156e (patch)
tree62adfdd84118b0869fd9cc5a684d38d037a9f529 /rust/migrations/2018-05-12-001226_init/up.sql
parent5feeb70f930e733587ad7fa33d361cf24602abca (diff)
downloadfatcat-8baa2d8808797e423829fb040d70206d24b6156e.tar.gz
fatcat-8baa2d8808797e423829fb040d70206d24b6156e.zip
fix CHECK clauses
Diffstat (limited to 'rust/migrations/2018-05-12-001226_init/up.sql')
-rw-r--r--rust/migrations/2018-05-12-001226_init/up.sql14
1 files changed, 7 insertions, 7 deletions
diff --git a/rust/migrations/2018-05-12-001226_init/up.sql b/rust/migrations/2018-05-12-001226_init/up.sql
index a6384f4e..d94e9b71 100644
--- a/rust/migrations/2018-05-12-001226_init/up.sql
+++ b/rust/migrations/2018-05-12-001226_init/up.sql
@@ -47,7 +47,7 @@ CREATE INDEX changelog_editgroup_idx ON changelog(editgroup_id);
CREATE TABLE abstracts (
-- fixed size hash (in hex). TODO: switch to bytes
- sha1 TEXT PRIMARY KEY CHECK (octet_length(sha1) == 40),
+ sha1 TEXT PRIMARY KEY CHECK (octet_length(sha1) = 40),
content TEXT NOT NULL
);
@@ -60,7 +60,7 @@ CREATE TABLE creator_rev (
given_name TEXT,
surname TEXT,
-- fixed size identifier
- orcid TEXT CHECK(octet_length(orcid) == 19),
+ orcid TEXT CHECK(octet_length(orcid) = 19),
-- limited size for data quality
wikidata_qid TEXT CHECK(octet_length(wikidata_qid) <= 12)
@@ -103,7 +103,7 @@ CREATE TABLE container_rev (
name TEXT NOT NULL,
publisher TEXT,
-- fixed size identifier
- issnl TEXT CHECK(octet_length(issnl) == 9),
+ issnl TEXT CHECK(octet_length(issnl) = 9),
-- limited size for data quality
wikidata_qid TEXT CHECK(octet_length(wikidata_qid) <= 12),
abbrev TEXT,
@@ -142,9 +142,9 @@ CREATE TABLE file_rev (
size BIGINT,
-- fixed size hashes (in hex). TODO: switch to binary type type
- sha1 TEXT CHECK(octet_length(sha1) == 40),
- sha256 TEXT CHECK(octet_length(sha256) == 64),
- md5 TEXT CHECK(octet_length(md5) == 32),
+ sha1 TEXT CHECK(octet_length(sha1) = 40),
+ sha256 TEXT CHECK(octet_length(sha256) = 64),
+ md5 TEXT CHECK(octet_length(md5) = 32),
mimetype TEXT
);
@@ -198,7 +198,7 @@ CREATE TABLE release_rev (
pmid TEXT CHECK(octet_length(pmid) <= 12),
pmcid TEXT CHECK(octet_length(pmcid) <= 12),
wikidata_qid TEXT CHECK(octet_length(wikidata_qid) <= 12),
- isbn13 TEXT CHECK(octet_length(isbn13) == 13),
+ isbn13 TEXT CHECK(octet_length(isbn13) = 13),
core_id TEXT CHECK(octet_length(core_id) <= 12),
volume TEXT,
issue TEXT,