aboutsummaryrefslogtreecommitdiff
path: root/initialize.sql
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2023-12-26 01:42:55 +0100
committerPřemysl Eric Janouch <p@janouch.name>2023-12-26 01:42:55 +0100
commit7db31fb880b719725bcf08a1345e96218c4330ce (patch)
treed3f2996ea2e4293ecb2a78d1b8f985bf77f66577 /initialize.sql
parent2e862c3e36cfdb8c656dae6ec3a72e23566c55b8 (diff)
downloadgallery-7db31fb880b719725bcf08a1345e96218c4330ce.tar.gz
gallery-7db31fb880b719725bcf08a1345e96218c4330ce.tar.xz
gallery-7db31fb880b719725bcf08a1345e96218c4330ce.zip
Check sha1 format in DB
Diffstat (limited to 'initialize.sql')
-rw-r--r--initialize.sql1
1 files changed, 1 insertions, 0 deletions
diff --git a/initialize.sql b/initialize.sql
index 84a37a9..3df2d49 100644
--- a/initialize.sql
+++ b/initialize.sql
@@ -5,6 +5,7 @@ CREATE TABLE IF NOT EXISTS image(
thumbw INTEGER, -- cached thumbnail width, if known
thumbh INTEGER, -- cached thumbnail height, if known
dhash INTEGER, -- uint64 perceptual hash as a signed integer
+ CHECK (unhex(sha1) IS NOT NULL AND lower(sha1) = sha1),
PRIMARY KEY (sha1)
) STRICT;