cds-snc / covid-alert-server

Exposure Notification: Diagnosis Server implementation / Notification d’exposition : Mise en œuvre du serveur de diagnostic
Apache License 2.0
298 stars 31 forks source link

fix: drop old duration table replace with new one #429

Closed CalvinRodo closed 3 years ago

CalvinRodo commented 3 years ago

fixes #428

Description of what your PR accomplishes:

This PR adds a migration that will drop the otk_life_durations table and create a new one in it's place that uses the originator and hours as a unique key constraint on the table instead of originator and duration

Why this approach? Any notable design decisions?

As the data we previously captured is essentially worthless due to this bug and we cannot re-generate the actual metrics dropping the table and recreating it through a migration is the easiest solution to this bug.

Anything the reviewers should focus on? Any discussion points?

Make sure that migration works.