It's taking you so long because of this for loop:
objects= MyModel.objects.active().filter(my_boolean=False) for object in objects: object.my_boolean = None object.save() # Database roundtrip
Namely, for each object, you are hitting the database. The better way is to bulk_update
the fields all at once:
objects= MyModel.objects.active().filter(my_boolean=False).update(my_boolean=None)
You can perform the query above inside your shell. It's better not to include it in your migration files for it may be executed each time you run migrations.
Enter you Django
shell by python manage.py shell
, import your model, and execute the query above.