From 4fc6a277494323554f15b5361c53c283ee1f1376 Mon Sep 17 00:00:00 2001 From: Palapeli <26661008+mkwcat@users.noreply.github.com> Date: Wed, 1 Apr 2026 15:22:47 -0400 Subject: [PATCH] Fix subquery in check constraint --- schema.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schema.sql b/schema.sql index 626d7b7..e846d50 100644 --- a/schema.sql +++ b/schema.sql @@ -71,7 +71,7 @@ CREATE TABLE IF NOT EXISTS public.sake_records ( table_id character varying NOT NULL, record_id integer NOT NULL DEFAULT (random() * 2147483647)::integer, owner_id integer NOT NULL, - fields jsonb NOT NULL CHECK (jsonb_typeof(fields) = 'object' AND jsonb_array_length(fields) <= 64), + fields jsonb NOT NULL CHECK (jsonb_typeof(fields) = 'object' AND jsonb_array_length(jsonb_path_query_array(fields, '$.keyvalue().key')) <= 64), create_time timestamp without time zone DEFAULT CURRENT_TIMESTAMP, update_time timestamp without time zone DEFAULT CURRENT_TIMESTAMP,