wacrm/supabase
Arnas Donauskas 79c60eeaea
fix(migrations): make 017 RLS rewrite re-runnable
017 claimed to be idempotent but only dropped the *legacy* policy names
before recreating; the new policies (contacts_select, …) were created
unguarded. A second run therefore failed with
`42710: policy "contacts_select" for table "contacts" already exists`.

Drop every policy on the tables 017 manages (it owns all RLS on them —
no later migration adds others) in a DO block before the CREATEs, so the
rewrite re-establishes the full set on every run.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 09:48:47 +03:00
..
migrations fix(migrations): make 017 RLS rewrite re-runnable 2026-06-22 09:48:47 +03:00