From d010db9791bc187153dda1855059999a500ee3ad Mon Sep 17 00:00:00 2001
From: Bryan Newbold <bnewbold@robocracy.org>
Date: Tue, 29 Jan 2019 15:44:52 -0800
Subject: be less arbitrary about octet_length checks: mostly just >= 1

We're just checking that strings aren't empty, not that they have any
particular length.
---
 rust/migrations/2019-01-01-000000_init/up.sql | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'rust/migrations/2019-01-01-000000_init/up.sql')

diff --git a/rust/migrations/2019-01-01-000000_init/up.sql b/rust/migrations/2019-01-01-000000_init/up.sql
index 2bb3f4ec..eabb201e 100644
--- a/rust/migrations/2019-01-01-000000_init/up.sql
+++ b/rust/migrations/2019-01-01-000000_init/up.sql
@@ -80,7 +80,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),
-    content             TEXT NOT NULL CHECK (octet_length(content) >= 8)
+    content             TEXT NOT NULL CHECK (octet_length(content) >= 1)
 );
 
 CREATE TABLE refs_blob (
@@ -183,7 +183,7 @@ CREATE TABLE file_rev (
     sha1                TEXT CHECK (octet_length(sha1) = 40),
     sha256              TEXT CHECK (octet_length(sha256) = 64),
     md5                 TEXT CHECK (octet_length(md5) = 32),
-    mimetype            TEXT CHECK (octet_length(mimetype) >= 3)
+    mimetype            TEXT CHECK (octet_length(mimetype) >= 1)
 );
 
 CREATE INDEX file_rev_sha1_idx ON file_rev(sha1);
-- 
cgit v1.2.3

