diff --git a/.claude/rules/database.md b/.claude/rules/database.md index 14d4b318..6abb3352 100644 --- a/.claude/rules/database.md +++ b/.claude/rules/database.md @@ -15,6 +15,8 @@ paths: ["supabase/migrations/**", "supabase/tests/**", "packages/supabase/**", " from public and granted only to the roles that evaluate them. - A migration is never edited once applied. Each migration ships its pgTAP file with allowed AND denied cases, and a regenerated `database.types.ts`. +- Every migration step runs first on the throwaway sandbox (`pnpm db:sandbox`, + `scripts/db-sandbox.sh`), never against DEV; changes to DEV stay owner actions (LRN-080). - The browser holds the anon key only. The `service_role` key value never appears in env.js, .env.example or code; operator scripts under `packages/*/scripts/` read it from the environment and are never bundled. - pgTAP files run on PGlite and on the real image: scope counts to fixture ids, pin `collate "C"` on text ordering.