Skip to content

BE-M0-23 · The sealed E2E organization in seed.sql

ID BE-M0-23 · Level L0 · Pack Pack D · Seed and Storage · Run order row 21 · Issue #13

supabase/seed.sql makes the sealed E2E organization (pools E2A and E2B, legal entity E2E and one test bank account) on every pnpm supabase db reset; committed. It runs on the local stack and, later, on staging; never on production (OQ14).

  • BE-M0-22 is Done. You are on the branch supabase/seed-storage in ~/opleet-v2/opleet, git status --short prints nothing, and the stack is running.
Terminal window
cp -R ~/opleet-v2/packs/be-pack-d/BE-M0-23/. .
git status --short

2 · Rebuild the local database, now with the seed, then run every test

Section titled “2 · Rebuild the local database, now with the seed, then run every test”
Terminal window
pnpm supabase db reset
pnpm supabase test db
Terminal window
git add supabase/seed.sql
git commit -m "feat(supabase): the sealed E2E organization in seed.sql"
  • Block 1: ?? supabase/seed.sql.
  • Block 2: db reset prints “Seeding data from supabase/seed.sql...” after the last migration and ends with “Finished supabase db reset”; test db ends with “All tests successful.”, “Files=12, Tests=265” and “Result: PASS”. The tests make their own rows and roll them back, so the seed changes no count.
  • Block 3: the commit line with 1 file changed.
Terminal window
docker exec supabase_db_opleet psql -U postgres -At -c "select o.slug, string_agg(p.code, ',' order by p.code), (select count(*) from public.legal_entities l where l.organization_id = o.id), (select count(*) from public.company_bank_accounts b where b.organization_id = o.id) from public.organizations o join public.pools p on p.organization_id = o.id where o.slug = 'e2e' group by o.id, o.slug"
git log --oneline -1

e2e|E2A,E2B|1|1, then “feat(supabase): the sealed E2E organization in seed.sql”.

  • db reset prints “WARN: no files matched pattern: supabase/seed.sql”: block 1 didn't copy the file. Run block 1 again and paste its output if the file is still missing.
  • db reset stops while seeding: paste the error 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.

Not committed yet: rm supabase/seed.sql, then pnpm supabase db reset. Committed: git reset --hard HEAD~1, then pnpm supabase db reset. Nothing has been pushed.

Not run yet. Log each run as a comment on #13.