Separated data constants (dev-seed-data.ts) from runner logic (dev-seed.ts) for maintainability
Used logtoSub="dev-user-seed" as idempotency sentinel — single check gates entire script
Global items are deduplicated by brand+model to avoid conflicts with existing seed-global-items.json data
Tag assignments skip existing links to stay idempotent at the row level
duration
completed
tasks_completed
tasks_total
files_created
files_modified
~4m
2026-04-06
2
2
2
1
Quick Task 260406-j44: Comprehensive Dev Seed Script Summary
Idempotent dev seed script populating PostgreSQL with 36 global items, 30 tag assignments, 10 categories, 17 user items (10 catalog-linked + 7 standalone), 3 threads with 7 candidates, 2 setups, and user settings for realistic bikepacking gear development.
feat(quick-260406-j44): add idempotent dev seed runner and db:seed:dev script
Task Details
Task 1: Create seed data constants
Created src/db/dev-seed-data.ts with typed constant arrays covering all entity types. Data uses real bikepacking gear brands (Revelate Designs, Zpacks, Enlightened Equipment, Nitecore, etc.) with accurate weights and prices in cents. Includes a categoryDisplayName() helper for mapping seed category slugs to display names.
Task 2: Create seed runner and wire npm script
Created src/db/dev-seed.ts with FK-ordered insertion (users -> categories -> global items -> tags -> items -> threads -> candidates -> setups -> setup_items -> settings). Idempotency check queries for logtoSub = "dev-user-seed". Global items are deduplicated against existing seed-global-items.json data by brand+model. Added db:seed:dev script to package.json.