From a65cc6dcfe54a6e0fbd78ebcf203e0f3698c43e7 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Wed, 23 Oct 2024 18:02:47 +1100 Subject: [PATCH] schema: Fix check constraints on template crop/location --- postgres/schema.sql | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/postgres/schema.sql b/postgres/schema.sql index 29b9dd8..c62f208 100644 --- a/postgres/schema.sql +++ b/postgres/schema.sql @@ -191,8 +191,6 @@ CREATE TABLE templates ( image BYTEA NOT NULL, description TEXT NOT NULL DEFAULT '', attribution TEXT NOT NULL DEFAULT '', - crop INTEGER[] NOT NULL CHECK ( - cardinality(thumbnail_crop) = 4), - location INTEGER[] NOT NULL CHECK ( - cardinality(thumbnail_crop) = 4) + crop INTEGER[] NOT NULL CHECK (cardinality(crop) = 4), + location INTEGER[] NOT NULL CHECK (cardinality(location) = 4) );