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

╄→尐↘猪︶ㄣ 提交于 2019-12-25 03:54:34

问题


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")

来源:https://stackoverflow.com/questions/25020732/django-south-cant-migrate-field-relation-already-exists

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!