OpenSourceFellows / amplify-back-end

The API backend for ProgramEquity
https://www.programequity.com/
MIT License
11 stars 0 forks source link

Drop unique requirement for `template_id` column in `letter_versions` table #183

Closed JamesMGreene closed 2 years ago

JamesMGreene commented 2 years ago

Ran into some unexpected migration failures when running #147 against the production database. 😖

JamesMGreene commented 2 years ago

P.S. Props to @nawazkhan for suggesting I remove this in #147. I should've checked the production data more carefully. 😓

JamesMGreene commented 2 years ago

For posterity, this was the associated deployment failure (slightly scrubbed):

       migration file "20211230165827_harden-letter_versions-table.js" failed
       migration failed with error: alter table "letter_versions" add constraint "letter_versions_template_id_unique" unique ("template_id") - could not create unique index "letter_versions_template_id_unique"
alter table "letter_versions" add constraint "letter_versions_template_id_unique" unique ("template_id") - could not create unique index "letter_versions_template_id_unique"
Key (template_id)=(tmpl_idHasBeenScrubbedHere) is duplicated.