Open hugorodgerbrown opened 3 years ago
I am on Django==1.11.29, and when installing django-waffle, I now get the following error:
waffle.Flag.everyone: (fields.E110) BooleanFields do not accept null values.
HINT: Use a NullBooleanField instead.
Could it be related to this change?
@mrxsal Django 1.x has not been supported for quite some time. We cannot help you with those errors. You’ll need to either upgrade Django, or use an older version of Django-Waffle.
Thanks. django-waffle==1.0.0 works.
If you run the test suite against Django 4.0a1, it'll fail on setup with the following message:
The migration that fails is
0004_update_everyone_nullbooleanfield
, which, rather embarrassingly, was added by me when Django dropped theNullBooleanField
. (See commit https://github.com/django-waffle/django-waffle/commit/4e365fef4e7c131ca4c344ef5751eeec77da9c86).It looks like the problem is caused by going from a
NullBooleanField
(no longer supported) to aBooleanField
- which occurs in migration 0004. This situation would not occur in a mature codebase, where this migration has already been applied, however it does appear in test runs where the database is being set up, and will occur for anyone who addsdjango-waffle
if to a Django 4+ project.I believe the solution is to retrospectively edit the existing migrations to remove the
NullBooleanField
references. I'll submit a PR just to check it passes CI.