Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds the seed script, which loads the catalog from
data/into the database and fills the search tables. Run it withnpm run db:seed.What it does
data/*.json, and converts them to the new shape (variant groups as a column, apparatus sort order)DATA_MODEL.md, it stops with a clear message and changes nothingCatalogEntryandCatalogWordon every runDecisions
hstdalso giveshandstand, andLBgiveslow bar. The list was reviewed by the team:fwd,bwd,swd,hstd,hdst,HB,LB,sec.andmin..etc.is left out on purpose. A test fails if the data contains an abbreviation that is in neither list.normalizeWordsinbackend/src/catalog/words.tslowercases, removes accents and keeps codes like3.304whole. The search in Add indexes and search #24 must use it too.data/getsremovedAt. It is deleted only if no routine or gymnast list uses it, andremovedAtis cleared if it comes back.SYN-are ignored. They are synthetic test data from another script.data/contains after the corrections in the extraction work.How to test
npm ci, thennpm run db:migrate, from the rootnpm run db:seedtwice. The second run should show only zerosnpm testLook at the data in the browser
npm run db:studiofrom the roothttp://localhost:51212. The port can change between runsElementorCatalogWord, to see the rowsIf a table says "No data", check that Studio is still running and reload the page. Changes you make to the catalog in Studio are overwritten by the next seed.
The README has the same steps under "Database (local setup)", in "6. Seeding" and "7. Look at the data".
Closes #23
🤖 Generated with Claude Code