django - Revert migration on deleted not null field -


i've got model non-null field deleted:

class spam(models.model):     slug = models.slugfield(allow_unicode=true)  # deleted 

after made migrations , applied them, wanted revert them. obviously, results in

django.db.utils.integrityerror: not null constraint failed: eggs_spam.slug 

how can revert migration?

that's tricky. solution can think of following:

1: first, create migration allows slug field nullable

2: then, create migration populate field every row

3: lastly, create migration makes field non-nullable.

hope helps


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -