FOREIGN KEY constraint failed - Any newly created superuser causes the error when attempting to modify a user

I believe that’s the case.

I did find this other thread that seems to be the exact same issue as mine, where someone pointed out that running the first migration before changing AUTH_USER_MODEL can be the cause.

When I first built the database, I had to work around a certain issue, as a result I ran the first migration before changing AUTH_USER_MODEL. There’s likely an empty user table in the database, which would explain why it doesn’t matter how far back I pull my backup from, and would also explain why the production database is not having the issue (AUTH_USER_MODEL was configured before the first migration).

I did try to generate a superuser by manually creating specifically an Employee through the shell, constraint still failed. That part I found very strange, because both the target user and the admin user were created as an Employee object specifically. If the issue really is coming from the AUTH_USER_MODEL not being configured before the first migration, it sounds like it’s a django issue that should be addressed.

I’ll be investigating this potential cause a bit further and reporting back here.
I’m probably just going to end up rebuilding the local database if I can’t find an answer very soon though, I do have deadlines and this issue has cost me 2 days of productivity.