jovandeginste / workout-tracker

A workout tracking web application for personal use (or family, friends), geared towards running and other GPX-based activities
Other
958 stars 30 forks source link

Ensure the workout-mapdata relation is a 1-1 mapping #102

Closed jovandeginste closed 7 months ago

jovandeginste commented 7 months ago

We add an uniqueIndex constraint on the WorkoutID column, to ensure it remains a 1-1 relation. Since there may already be duplicate records in the table, we need to perform a pre-migration cleanup. This may happen before the table is even created (first run), so we need to check if the table exists.

We also update our tests, since they seemed to add extra records!