MOTIR-391Done
6.10.6 Seed loader — model the `moooon` org over its workspace(s); backfill in `pnpm db:seed`
Estimate: 40m · Depends on: 6.10.3
Teach the seed loader (scripts/plan-seed/seed.ts + the seed data) about the org tier so pnpm db:seed models the moooon org over its workspace(s) — the dev/demo data that exercises the new hierarchy. This keeps the seeded world consistent with the 6.10.3 schema + the 6.10.4 gating (every seeded workspace lives under an org; the seeding owner is an org owner).
- Create the
moooonOrganizationand attach the existing seeded workspace(s) to it viaorganizationId(the seed’s workspaces no longer top-level-orphan — they nest undermoooon). - Create an
OrganizationMembership(owner)for the seed’s owning/admin user, plus a couple of org members at different org-roles (owner / admin / member) so the cross-workspace member management UI (6.10.5) + the e2e (6.10.8) have realistic data. - Apply the SAME backfill rule the 6.10.3 migration uses (idempotent: re-seeding does not duplicate the org / memberships) so seed + migrate agree.
- If the plan-seed world models MORE than one workspace, attach them under
moooon(or a second seeded org if the demo needs the multi-org switcher case) — pick whichever exercises the org switcher + cross-workspace roster. Document the choice in the seed module.
Acceptance criteria
- After
pnpm db:seed, themoooonOrganizationexists, owns its workspace(s) (each workspace’sorganizationIdpoints at it), and has an ownerOrganizationMembershipfor the seed owner + a few members at varied org-roles. - Re-running
pnpm db:seedis idempotent (no duplicate org / memberships) and agrees with the 6.10.3 migration backfill. - The seeded world satisfies the 6.10.4 gate (no seeded workspace is orphaned from an org; the seed owner can administer it as org owner).
Context refs
- 6.10.3 — the schema + the backfill rule the seed mirrors (idempotent).
motir-core/scripts/plan-seed/seed.ts— the loader to extend (it already builds themoooon/motirworkspace + project tree).- 6.10.4 — the gate the seeded data must satisfy.
motir-core/CLAUDE.md§ 4-layer (the seed goes through the same repositories where practical).