I’m updating a database from v13.5 to v17.
There is one table which originally had no primary key, so we added one at some point. Now we have a situation where some records have a primary key (recordNumber") and some don’t (they are 0).
So in our update code we find all the records in that table that have recordNumber=0 and assign record numbers to them. But whenever the method tries to save a record with a newly-assigned recordNumber it doesn’t save and we get the “non-unique primary key was found in table ListItems” error.
I have checked and the recordnumber being assigned definitely IS DEFINITELY unique.
Of course there are still non-unique recordNumbers in the table - the ones that are still = 0 - but that shouldn’t cause this problem should it? As long as the record being saved is unique it should be OK, right?
What am I missing?
Do I need to get more sleep?