Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
848 views
in Technique[技术] by (71.8m points)

python - Django. South. Can't migrate field: relation already exists

I've been having lots of problems with South, I just can't add new fields.

So this is what I did:

  • dropped the south_migrationhistory table from the database, deleted all the migration folders and uninstalled south "pip uninstall south".
  • then, installed south again.
  • ran syncdb to create the south table on the db.
  • converted_to_south the app where I want to add the fields. (everything working fine till this point)
  • ran schemamigration app --auto. And it gave me the regular message "+added field ... you can now apply this migration with .manage.py migrate app"
  • did "python manage.py migrate app".

Get this error:

ProgrammingError: column "profile_image" of relation "profiles_profiles" already exists. (the new fields I want to add are called "nickname" and "profile_image", the app name is called "profiles" and the model is called "profiles" as well).

I think I'm doing exactly what the docs write.

What I have tried:

  • deleting everything and starting again a couple of times.

  • faking a migration and then running "migrate" again. (I get "nothing to migrate", and then the same error "relation already exists")

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...