Fix subquery in check constraint

This commit is contained in:
Palapeli 2026-04-01 15:22:47 -04:00
parent d14fd2e737
commit 4fc6a27749
No known key found for this signature in database
GPG Key ID: 1FFE8F556A474925

View File

@ -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,