From 11ff1fadfa722c6bc72e286f418999229279fbac Mon Sep 17 00:00:00 2001 From: jm Date: Wed, 14 Oct 2026 22:21:55 +0000 Subject: [PATCH] fix(db): align IFC origin schema constraint Co-authored-by: Codex Signed-off-by: jm --- schema/tables/public/events.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/schema/tables/public/events.sql b/schema/tables/public/events.sql index 4c3f9d9c45..7fcc8f74b6 100644 --- a/schema/tables/public/events.sql +++ b/schema/tables/public/events.sql @@ -37,7 +37,8 @@ CREATE TABLE events ( d_tag TEXT, not_before BIGINT, delivered_at BIGINT, - origin_generation BIGINT CHECK (origin_generation IS NULL OR origin_generation > 0), + origin_generation BIGINT CONSTRAINT chk_events_origin_generation + CHECK (origin_generation IS NULL OR origin_generation > 0), PRIMARY KEY (community_id, created_at, id) ) PARTITION BY RANGE (created_at);