Description
Development is slow because local workflows often require rerunning the full legacy import. Add a fast local dev seed based on a curated real-data JSON fixture exported from a known-good imported database.
Goal
Create a deterministic seed file that can reset and repopulate local dev data quickly without rerunning import:bootstrap.
Requirements
- Add an export script that writes a relationship-complete JSON fixture from a fully imported local DB.
- Store the fixture under
packages/db/fixtures/, for example dev-seed.json.
- Update
db:seed:initial-test-data to reset app-domain data and load the fixture.
- Preserve auth/admin users.
- Sanitize people-related data before committing:
- owners
- breeder owner/person fields
- judges if treated as personal data
Fixture coverage
- Trials:
- include examples for
trw_range_2005_2011
- include examples for
trw_post_20110801
- include examples for
trw_post_20230801
- include linked dogs, registrations, trial events, entries, eras, lisatiedot, scores, statuses, and owner snapshots
- Shows:
- include pre-
2003-01-01 legacy class+digit quality stored as LEGACY-LAATUARVOSTELU
- include post-
2003-01-01 class+digit normalized to modern quality
- include modern
PUPN, SIJOITUS, quality, and awards examples
Docs
-
Document fixture export/refresh command.
-
Document fast reseed command:
pass-cli run --env-file .env.local -- pnpm db:seed:initial-test-data
-
Clarify that import:bootstrap remains the real migration path.
Acceptance criteria
- Seed can be run repeatedly with stable counts.
- Seed does not require legacy MariaDB/import.
- Public dog profile, show detail, trial detail/PDF, admin show, and admin trial pages have usable data.
pnpm --filter @beagle/db typecheck passes.
Description
Development is slow because local workflows often require rerunning the full legacy import. Add a fast local dev seed based on a curated real-data JSON fixture exported from a known-good imported database.
Goal
Create a deterministic seed file that can reset and repopulate local dev data quickly without rerunning
import:bootstrap.Requirements
packages/db/fixtures/, for exampledev-seed.json.db:seed:initial-test-datato reset app-domain data and load the fixture.Fixture coverage
trw_range_2005_2011trw_post_20110801trw_post_202308012003-01-01legacy class+digit quality stored asLEGACY-LAATUARVOSTELU2003-01-01class+digit normalized to modern qualityPUPN,SIJOITUS, quality, and awards examplesDocs
Document fixture export/refresh command.
Document fast reseed command:
pass-cli run --env-file .env.local -- pnpm db:seed:initial-test-dataClarify that
import:bootstrapremains the real migration path.Acceptance criteria
pnpm --filter @beagle/db typecheckpasses.