mirror of
https://github.com/tiennm99/bsk.git
synced 2026-08-25 04:25:14 +00:00
npm run db:migrate-upstream imports a BSK.db file into the bsk schema via node:sqlite: re-keys all ids, maps shift 0/1 to morning/afternoon, converts RTF template content to field labels, keeps pre-1970 birth dates, folds suggestion/service-notes/ultrasound-doctor into visit notes, and warns on every dropped or unmappable value. Pure transforms live in scripts/upstream-transforms.mjs with a unit suite. Also grants service_role the table privileges PostgREST needs for this and the existing seed scripts.