Using South to convert ForeignKey TO ManyToManyField not working out

Viewed 3243

I am using South to change a ForeignKey TO ManyToManyField in one of the models in Django but it is not working out as expected.

# Original Schema
class Item(models.Model):
    category = models.ForeignKey(Category, default=default_category)

To be changed to

# Original Schema
class Item(models.Model):
    category = models.ManyToManyField(Category, default=default_category)

So after commenting out the ForeignKey line in the model I do,

python manage.py schemamigration affected_model --auto
 ? The field 'Item.category' 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: 

I am confused by this because 1. I have specified a default value which is "default_category" and 2. I am not removing any field I am just changing it to ManyToManyField. My question is how to go ahead in this case? Is there any other trick to make this conversion using South?

BTW I am using South 0.7 and Django 1.1.1

Thanks for the help.

1 Answers
Related