diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2023-12-26 01:42:55 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2023-12-26 01:42:55 +0100 |
commit | 7db31fb880b719725bcf08a1345e96218c4330ce (patch) | |
tree | d3f2996ea2e4293ecb2a78d1b8f985bf77f66577 | |
parent | 2e862c3e36cfdb8c656dae6ec3a72e23566c55b8 (diff) | |
download | gallery-7db31fb880b719725bcf08a1345e96218c4330ce.tar.gz gallery-7db31fb880b719725bcf08a1345e96218c4330ce.tar.xz gallery-7db31fb880b719725bcf08a1345e96218c4330ce.zip |
Check sha1 format in DB
-rw-r--r-- | initialize.sql | 1 |
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; |