So I messed up by starting with using the user’s email as a primary key. Turns out that’s not good, so I did the migrations to turn the pk back into an AutoField.
“Internally”, if we just look at the User model itself, that worked out fine, even with existing users.
But now I get errors where the permissions table still wants to use user.email
as the primary key to use in the permissions table.
This happens even in my unit tests, which should create a test database in memory from scratch. Which tells me that the auth-migrations don’t get correctly updated. (In particular for the unit-tests it should not require data migrations, because it’s empty anyway)
The only way to get this error to go away, which I’m not sure I’m 100% committed to, is to delete all the migrations and create them from scratch.
Any way around that brute-force reset?
Thanks!