GREG-208: Adding constraint to prevent identity duplicates
I added a constraint for (identity type, value) on the identity table.
Before this change is applied the database in the environments should be checked to make sure there are no duplicate IDs so that the migration will succeed. It is OK for UiB production since we have so few people there, for the UiB test environment I need to do some updates probably, and I don't know how the situation is for UiO. It is easy to the if you can run a SQL-query against the database.
I added error message to three places on the frontend where this problem can arise:
Merge request reports
Activity
Jeg syns dette blir den riktige måten å migrere denne gangen. Dersom det er duplikater må rett og slett noen fikse det manuelt før man prøver å migrere på nytt. Hadde opprinnelige noen tanker om at migrasjoner i django burde skrives slik at de alltid fullfører, men her har du fått meg til å endre mening
mentioned in commit 0a5ec39b