From efe9437f20f47a36585b80ee077d36151ff42da1 Mon Sep 17 00:00:00 2001 From: czlonkowski <56956555+czlonkowski@users.noreply.github.com> Date: Wed, 12 Nov 2025 16:39:06 +0100 Subject: [PATCH] fix: correct SQL syntax for expression index in workflow_mutations schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The expression index for significant changes needs double parentheses around the arithmetic expression to be valid PostgreSQL syntax. Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en --- docs/migrations/workflow_mutations_schema.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/migrations/workflow_mutations_schema.sql b/docs/migrations/workflow_mutations_schema.sql index 9d5e83a..b6388be 100644 --- a/docs/migrations/workflow_mutations_schema.sql +++ b/docs/migrations/workflow_mutations_schema.sql @@ -120,9 +120,9 @@ CREATE INDEX IF NOT EXISTS idx_workflow_mutations_validation_success CREATE INDEX IF NOT EXISTS idx_workflow_mutations_user_time ON workflow_mutations(user_id, created_at DESC); --- Find mutations with significant changes +-- Find mutations with significant changes (expression index) CREATE INDEX IF NOT EXISTS idx_workflow_mutations_significant_changes - ON workflow_mutations(nodes_added + nodes_removed + nodes_modified) + ON workflow_mutations((nodes_added + nodes_removed + nodes_modified)) WHERE (nodes_added + nodes_removed + nodes_modified) > 0; -- Comments for documentation