Backfill Reference Tables

Runs a full, one-shot FK-id repair pass across jockey, trainer, and runner (horse) — every already-migrated row in each, from the very first to the most recent, re-resolving country_id (jockey/trainer) and trainer_id (runner) against current config_id_mappings. It fixes ids only — ordinary data columns (e.g. a jockey/trainer's licence end_date, a runner's silk_description) are deliberately left untouched.

These three tables are never covered by Backfill Everything or any sync job's own table list, because they're only ever populated as a side effect of migrating run (auto-copied on the fly when a run references a jockey/ trainer/horse that hasn't been migrated yet) — they're never selected as a table in a sync job themselves. Meeting Compare's tick/cross can still flag FK mismatches on them (that's how this page came about), but nothing was backfilling the fix — this page is the fix, scoped to exactly these three and to id columns only, sized so a full pass should take minutes, not hours.

  • Jockeys tbljockeys
  • Trainers tbltrainers
  • Runners (horses) tblhorse

Preview runs the same reads and comparisons but skips every write — it reports how many rows each table would change, plus a few sample changes in the Activity Log.

Scheduled Backfill

Runs this same jockey/trainer/runner backfill automatically on a recurring interval, instead of only ever running it by hand. A scheduled run is skipped (and retried shortly after) if any sync job is currently mid-tick, so it never runs alongside one.

1440 = daily · 10080 = weekly