kustomrtr
kustomrtr

Reputation: 1487

Django and South: South not detecting when django models change

I've wasted all my day trying to make this work, but I couldn't.

Here's what I've done so far:

  1. Created an app and its models (no south at this point)
  2. Installed South on my system
  3. Added 'south' to my project settings
  4. Ran manage.py syncdb to create south migration tables
  5. Converted my app to south using: manage.py convert_to_south myapp. This created a migrations folder and an initial migration file.
  6. Changed my model (added a new field)
  7. Ran manage.py schemamigration myapp --auto
  8. It says NOTHING SEEMS TO HAVE CHANGED.

Here's my original model: https://gist.github.com/kustomrtr/8f4f4262634904b53d5f

Here's my MODIFIED model (added line 41): https://gist.github.com/kustomrtr/edab10975803c74b869a

Here's my initial migration file (created when I converted my app to south): https://gist.github.com/kustomrtr/2a4884be3177225a45e7

Can you help me please!

Thanks in advance.

Upvotes: 0

Views: 848

Answers (1)

kustomrtr
kustomrtr

Reputation: 1487

Someone pointed that the Manage = False in my models could cause the trouble. I tried commenting those lines and guess what:

C:\Users\Kevin\Desktop\difundelo>python manage.py schemamigration registros --auto
 ? The field 'Post.image' does not have a default specified, yet is NOT NULL.
 ? Since you are adding 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
 ? Please select a choice:

Voilá! It worked! I can finally keep working on my project!

PS: I don't know why the guy who commented the solution, deleted his comment. Thank you anonymous!!!

Upvotes: 1

Related Questions