migration
Create a new Supabase migration with RLS policies, update the hand-written Database types and the data model doc. Use for any schema change.
SKILL.md.claude/skills/migration/SKILL.md
GitHub- Create
supabase/migrations/<YYYYMMDDHHMMSS>_<snake_name>.sql(UTC timestamp). Never edit an existing migration. - In the file: tables with
venue_id+ FK +created_at/updated_at, theset_updated_attrigger, indexes for every FK you will filter on,enable row level security, and policies usingpublic.is_venue_staff(...)/public.is_night_participant(...). If the UI subscribes to the table, add it tosupabase_realtime. End with a-- down:comment describing manual rollback. - Update
packages/db/src/database.types.ts: add theRowinterface and theTablesentry. - Update
docs/DATA_MODEL.md: column table, RLS summary, and the Mermaid diagram. - If Docker is available:
pnpm db:resetand thenpnpm db:typesto regenerate types and confirm they match your hand-written version. If not, say so in the PR. - Run
pnpm check.