You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that when using a custom flag model, the original model and its many-to-many tables are still created.
If I just manually go into the waffle migrations and add 'swappable': 'WAFFLE_FLAG_MODEL' into the options dict of the CreateModel(name='Flag', ... migration, then the standard flag model and its m2m tables are NOT created, as I want.
Obviously that is not how the fix should be made, because that would break existing implementations, but I don't know exactly how to properly do these sorts of migrations; hoping someone here has more expertise.
The text was updated successfully, but these errors were encountered:
I had the same problem where the tests were broken because flush command was trying to truncate data and auth_user table was still referencing waffle_flag_users.
I made a workaround for this by creating custom models for flags, switches, and samples in my app and completely disabling migrations for the waffle app. Of course, this is only possible if you don't really care about the existing data.
settings.py:
MIGRATION_MODULES= {
"waffle": None,
}
But I suppose the real fix is to have a new breaking major version which has the swappable: WAFFLE_FLAG_MODEL like @djsmedes suggested.
It seems that when using a custom flag model, the original model and its many-to-many tables are still created.
If I just manually go into the waffle migrations and add
'swappable': 'WAFFLE_FLAG_MODEL'
into theoptions
dict of theCreateModel(name='Flag', ...
migration, then the standard flag model and its m2m tables are NOT created, as I want.Obviously that is not how the fix should be made, because that would break existing implementations, but I don't know exactly how to properly do these sorts of migrations; hoping someone here has more expertise.
The text was updated successfully, but these errors were encountered: