From 0ae87341485257e33b28754ff8f08e86cea35932 Mon Sep 17 00:00:00 2001 From: czlonkowski <56956555+czlonkowski@users.noreply.github.com> Date: Wed, 12 Nov 2025 16:57:45 +0100 Subject: [PATCH] fix: enable RLS policies for workflow_mutations table MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable Row-Level Security and add policies: - Allow anonymous (anon) inserts for telemetry data collection - Allow authenticated reads for data analysis and querying These policies are required for the telemetry system to function correctly with Supabase, as the MCP server uses the anon key to insert mutation data. Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en --- docs/migrations/workflow_mutations_schema.sql | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/migrations/workflow_mutations_schema.sql b/docs/migrations/workflow_mutations_schema.sql index b6388be..ec4d071 100644 --- a/docs/migrations/workflow_mutations_schema.sql +++ b/docs/migrations/workflow_mutations_schema.sql @@ -147,19 +147,19 @@ COMMENT ON COLUMN workflow_mutations.operations IS COMMENT ON COLUMN workflow_mutations.validation_improved IS 'Whether the mutation reduced validation errors (NULL if validation data unavailable)'; --- Row-level security (optional - uncomment if using Supabase auth) --- ALTER TABLE workflow_mutations ENABLE ROW LEVEL SECURITY; +-- Row-level security +ALTER TABLE workflow_mutations ENABLE ROW LEVEL SECURITY; -- Create policy for anonymous inserts (required for telemetry) --- CREATE POLICY "Allow anonymous inserts" --- ON workflow_mutations --- FOR INSERT --- TO anon --- WITH CHECK (true); +CREATE POLICY "Allow anonymous inserts" + ON workflow_mutations + FOR INSERT + TO anon + WITH CHECK (true); -- Create policy for authenticated reads (for analysis) --- CREATE POLICY "Allow authenticated reads" --- ON workflow_mutations --- FOR SELECT --- TO authenticated --- USING (true); +CREATE POLICY "Allow authenticated reads" + ON workflow_mutations + FOR SELECT + TO authenticated + USING (true);