Documentation
¶
Overview ¶
Command mkteam makes, reads and removes a TEAM the operator (user 1) manages, on the e2e database — for a browser spec on the shared password-mode server, which has no GoTrue and so no /admin/teams page to make one with. The browser session's principal reads its memberships from team_members on every request (principalFor), so a team made here is the operator's at once, with no new sign-in.
DATABASE_URL=…_e2e go run ./e2e/mkteam create <name> prints the team's id DATABASE_URL=…_e2e go run ./e2e/mkteam officers <id> prints how many officer defs and types it owns DATABASE_URL=…_e2e go run ./e2e/mkteam remove <id> removes it and its memberships
The rows are the ones users.CreateTeam writes (a users row of kind 'team', role 'member', and the first manager's membership), without its audit row. remove deletes the team's audit rows with it (the seed's accounts reset deletes the audit log whole anyway), so it leaves nothing that reset would trip on.
🔴 remove DELETES NO OFFICER ROW. A team that still owns one is a failure of the spec that made it (a refusal that did not refuse), so remove fails loudly on the foreign key rather than tidying the evidence away.
🔴 IT REFUSES ANY DATABASE WHOSE NAME DOES NOT END IN "_e2e" (e2edb.Check): it writes users and team_members as the login role, which nothing outside a fixture may do.