Sample scores
NBABOS 108NYK 104Q4 2:14LAL 87GSW 91Q3 1:42MIA 52CHI 48Q2 0:36
EPLARS 2CHE 12H 74:12LIV 1MCI 12H 58:06AVL 0FUL 01H 19:34
NHLNYR 3BOS 2P3 7:26TOR 1MTL 0P2 12:02SEA 2DAL 2P3 10:15
Explore the sports data API quickstart
blog

Why the schedule needs a stable event ID

How to keep one game intact across schedule changes, live updates, and historical imports.

2026-11-29 · PreciseData · 2 min read

A scheduled game lands in your database on Monday. On Tuesday its start time changes. By game day the record has a score, and the next morning it has a final box score. Readers expect every saved link to open the same game throughout that process.

A calendar slot can move

It's tempting to build a key from two team abbreviations and a start time. A postponement then produces a different key. An import may insert a second row while existing links continue to point at the old one. Two meetings between the same teams on the same day make a date-based shortcut even less reliable.

Give the local row a stable event identifier. Store scheduled time, participants, and state as fields that can be updated. A rescheduled game can then move to a new date in the UI without changing its detail link.

Apply updates twice

A background importer can finish writing a page and stop before it records its progress. On restart, the same page may arrive a second time. An upsert by event ID lets the job repeat the work and end with one game row.

Use that same key for scoreboard rows and for a relation to box scores. A scheduled row can move to a live section, then to a final section, while keeping its associated detail intact.

Keep the original reference

An existing application may already use IDs from a league, a publisher, or its own archive. Place those in a mapping table with the source's name. When a match needs correction later, you can revise one relationship and still trace where the original record came from. Guide to mapping IDs