Given the use of first, I suspect that caused issues where we just update one copy, and leave the other. Not sure if the order is always deterministic.
Just need to be sure to clean out duplicates, I think it's safe to delete the one we would not access using first. Need this in the script before adding the constraint, similar to what has been done for uuid constraints previously.
Seems like a very good idea.
Given the use of first, I suspect that caused issues where we just update one copy, and leave the other. Not sure if the order is always deterministic.
Just need to be sure to clean out duplicates, I think it's safe to delete the one we would not access using first. Need this in the script before adding the constraint, similar to what has been done for uuid constraints previously.