Remove problematic entries during migration
julesstrosahl opened this issue ยท 1 comments
Is your feature request related to a problem? Please describe.
I've found two issues won't be resolved during migration of users.db
with migrateTo3
: Rows with null uuid
, and duplicate shortname
. This fails fast migration, then fails again trying slow migration.
Describe the solution you'd like
Run these queries:
DELETE FROM `accounts-old` WHERE shortname in (select shortname from `accounts-old` group by shortname having count(1) >1);
DELETE FROM `accounts-old` WHERE uuid is NULL;
Describe alternatives you've considered
Running slow migration and inserting UUIDs for the null UUIDs. I think the issue is these rows shouldn't exist though, as from my testing they relate to names which have changed. Also, if they've changed their name between logging in and migration, the UUID will be incorrect.
For duplicate shortnames, I'm not sure how to reconcile this. Can this row actually be unique?
Additional context
N/A
I thought a bit about this now and this should really not be an issue, the slow migration will only fail on the one account with the issue and not insert that into the new table. It should not have any influence on all the other account as they will just insert into the new table one by one by the slow migration and therefore it doesn't really warrant any special handling.
It would've been good if you had provided the actual errors that occurred for you though.