19

When I am removing a NOT NULL field using Django South, I get the following message:

? The field 'VisitOrder.end_date' does not have a default specified, yet is NOT NULL.
? Since you are removing this field, you MUST specify a default
? value to use for existing rows. Would you like to:
?  1. Quit now, and add a default to the field in models.py
?  2. Specify a one-off value to use for existing columns now
?  3. Disable the backwards migration by raising an exception.
? Please select a choice: 

Why does South need this, given it's going to remove the field anyhow?

Ghopper21
  • 10,287
  • 10
  • 63
  • 92

1 Answers1

33

Django South allows you to move forwards or backwards through migrations. So, if you ever decided to undo a migration, South would re-create the fields that were deleted. That is why South is asking if you want to specify a default value or "disable the backwards migration by raising an exception."

Garrett Hyde
  • 5,409
  • 8
  • 49
  • 55
  • 4
    Thanks. To confirm, the third choice means "don't specify a default, in which case later on if you migrate backwards i.e. undelete this field, I'll throw an exception at that point"? – Ghopper21 Aug 07 '12 at 15:25
  • 1
    This clarification, though it may seem obvious, was quite necessary. Thank you. – Steph Rose Aug 25 '13 at 17:25
  • 1
    This helped me significantly. Up until this point, it seemed like nothing more than a 'nag prompt'. – Nicholas Hamilton Apr 09 '14 at 12:17