-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
extra migrations for user model - keeps on adding migrations with manager #6
Comments
struggling on the same issue for quite some time. |
I did some digging and narrowed it down to the issue being that During a run of the The workaround I have currently implemented is to define a custom model manager that inherits from Unfortunately, I don't really understand the django migration architecture enough to suggest any potential root cause fixes. |
The problem
Django keeps on adding extra migration for setting user manager for
User
class which inherits fromAbstractUser
.The setup
In the examples below I work on MySQL (5.7.23), use Python 3.7.3 and mysqlclient==1.3.13.
How to replicate the problem:
and:
gives me 'No changes detected' - so far so good.
User
class, which extendsAbstractUser
- I'm trying to make private only fields defined onAbstractUser
, not my onUser
.gives me:
The interesting thing for me to note was that the manager seems to have changed.
and again - migrations have been applied in both cases, looks good:
I get:
WHY? The change that Django is trying to make relates only to changing manager, and not to changing the
anonymised
field (which has already been added to the database).The text was updated successfully, but these errors were encountered: