Fix bug in uniqueness constraint migration