BE-M0-13 · Tenancy and access, settings, pool dates and document numbers
ID BE-M0-13 · Level L0 · Pack Pack B · Schema V13, domain by domain · Run order row 19 · Issue #11
Tenancy and access (organizations to overrides, profiles with locale, my_permissions(), set_my_locale()), settings, pool dates and document numbers pass their tests on the local stack; committed.
Before
Section titled “Before”- BE-M0-12 is Done. You are on the branch supabase/schema-v13 in ~/opleet-v2/opleet, git status --short prints nothing, and the stack is running.
1 · Check the rebuilt zip, and unzip it over the old one
Section titled “1 · Check the rebuilt zip, and unzip it over the old one”BE-M0-12 may have run from an earlier zip. This block and the next bring its files up to the zip of 2026-10-09 before step 13 adds its own.
shasum -a 256 ~/Downloads/be-pack-b.zipunzip -q -o ~/Downloads/be-pack-b.zip -d ~/opleet-v2/packs(cd ~/opleet-v2/packs/be-pack-b && shasum -a 256 -c SHA256SUMS)2 · Copy step 12's files again, then this step's files
Section titled “2 · Copy step 12's files again, then this step's files”cp -R ~/opleet-v2/packs/be-pack-b/BE-M0-12/. .cp -R ~/opleet-v2/packs/be-pack-b/BE-M0-13/. .git status --short3 · Rebuild the local database from every migration, then run every test
Section titled “3 · Rebuild the local database from every migration, then run every test”pnpm supabase db resetpnpm supabase test db4 · Commit
Section titled “4 · Commit”git add supabasegit commit -m "feat(supabase): tenancy, access, settings and document numbers"Expect
Section titled “Expect”- Block 1: be-pack-b.zip's SHA-256 as written under Pack B, then 23 lines ending in “: OK”.
- Block 2:
?? supabase/migrations/20261006000200_tenancy_access.sqland?? supabase/tests/database/13_tenancy_access.test.sql. If BE-M0-12 ran from the zip of 2026-10-08, alsoM supabase/migrations/20261006000100_foundation.sql(the permission action margin, D31): it goes into this step's commit. - Block 3: db reset applies 20261006000200_tenancy_access.sql last and ends with “Finished supabase db reset”; test db ends with “All tests successful.”, “Files=2, Tests=51” and “Result: PASS”.
- Block 4: the commit line with 2 files changed, or 3 with the foundation file.
pnpm supabase migration list --localgit log --oneline -1Expect 20261006000200 in both columns as the last row, then “feat(supabase): tenancy, access, settings and document numbers”.
If it fails
Section titled “If it fails”- db reset stops at a migration: the error names the file and the line. Paste it into the BE chat; don't edit the file.
- test db prints “not ok”: paste every “not ok” line and the lines under it. Don't commit.
- The stack isn't running:
pnpm supabase start, then the rebuild and tests again.
Not committed yet: git clean -fd supabase/migrations supabase/tests, then pnpm supabase db reset. Committed: git reset --hard HEAD~1, then pnpm supabase db reset. Nothing has been pushed; the earlier steps stay.
Not run yet. Log each run as a comment on #11.