Test-data reset: wipe current 12 projects + seed realistic 'Example Projects' that exercise the auto-derived code chain #87
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
m's request (2026-05-25 14:15)
Current state (live)
paliad.projectshas 12 rows, all created by m (matthias.siebels@hoganlovells.com). All are test data — references likeC-UPC-0001,L-2026-001,P-EP3456789, noopponent_codeset anywhere (which is why auto-derived chain codes don't render). Safe to wipe.Goal
SIEMENS.HUAW.789.INF.CFI).Suggested example tree (head's editorial — coder may refine)
Client 1 — Siemens AG (reference: SIEMENS)
SIEMENS.HUAW.789.INF.CFISIEMENS.HUAW.789.CCR.CFISIEMENS.HUAW.789.COASIEMENS.BOSCH.222.INF.LGSIEMENS.BOSCH.222.INF.LGClient 2 — Bayer AG (reference: BAYER)
BAYER.NOVA.333.OPPBAYER.NOVA.333.NUL.BPATGClient 3 — Beispiel AG (reference: BEISPL)
(intentionally sparse — demonstrates the empty-segment skip)
BEISPL.WTB.654or similarAdjust the exact proceeding_type IDs to whatever
paliad.proceeding_typeshas — query the table first; pick ones that produce nice.codetails.What to do
Phase 1 — Wipe (write a single transaction)
Figure out the full set of paliad.* tables that reference
paliad.projects(id)via FK and delete dependents in dependency order. Likely set:paliad.deadlines(anchors, actuals)paliad.appointmentspaliad.party_assignments(or whatever links parties to projects)paliad.partiesif they're project-scopedpaliad.notespaliad.events/ project_events audit feedpaliad.team_membershipspaliad.checklist_instancespaliad.submission_draftspaliad.custom_viewsIF they were created tied to a project (likely user-scoped, leave them)paliad.approval_requestsproject_idcolumn —SELECT table_name FROM information_schema.columns WHERE table_schema = 'paliad' AND column_name = 'project_id'Then
DELETE FROM paliad.projects;DO NOT touch:
paliad.proceeding_types,paliad.deadline_rules,paliad.event_types,paliad.gerichte,paliad.checklists(templates),paliad.firms, public schema, auth schema.Phase 2 — Seed (single transaction)
Write the seed in a Go script under
scripts/seed-example-projects/main.goso it's reproducible. Use the suggested tree above as the contract. Each insert:created_byto m's auth.users uuid (look up viaSELECT id FROM auth.users WHERE email = 'matthias.siebels@hoganlovells.com')referenceon client,opponent_codeon litigation,patent_numberon patent,proceeding_type_idon casepathcorrectly per parent-child chain (existing trigger may do this automatically — verify)status='active',typeper rowAfter seed: query
paliad.projectsand verify theBuildProjectCodehelper produces the expectedSIEMENS.HUAW.789.INF.CFI-style codes (just call the Go helper from the script and print).Optional: also seed 1-2 sample deadlines per case (anchored to a near-future date) and 1-2 sample appointments — so the dashboard / inbox have something to show. Keep it minimal — main demonstration is the project tree + codes.
Phase 3 — Verify
Hard rules
BEGIN; DELETE FROM paliad.projects; INSERT ...; COMMIT;(or whatever cascade order works) so future test-data resets are one command.go build ./... && go test ./internal/... && cd frontend && bun run buildclean (seed script must build).mai/<worker>/test-data-reset-and-seed.DATABASE_URL. Document which approach in the completion report.Out of scope
Reporting
mai report completedwith branch + SHAs + the resulting project tree (paste output ofSELECT title, paliad_internal_build_project_code(id) FROM paliad.projects ORDER BY pathor equivalent) + UX verification screenshot description.