Migrations

This commit is contained in:
2026-03-01 18:51:53 +08:00
parent 2100516238
commit 830c99a3ff
7 changed files with 160 additions and 0 deletions
@@ -0,0 +1,13 @@
-- Add permissive INSERT policy for anon (idempotent).
DO $$
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name='task_activity_logs') THEN
-- create policy only if it doesn't already exist
IF NOT EXISTS (
SELECT 1 FROM pg_policies WHERE tablename = 'task_activity_logs' AND policyname = 'allow_anon_insert'
) THEN
EXECUTE 'CREATE POLICY allow_anon_insert ON public.task_activity_logs FOR INSERT TO anon WITH CHECK (true)';
END IF;
END IF;
END
$$;