Due to merging several feature branches into my project, I have the following migrations:
0001_initial.py
0002_auto__add_field_userprofile_telephone__add_field_userprofile_timezone.py
0003_auto.py
0004_auto__del_field_organisation_admin.py
0005_auto__add_field_organisation_permitted_domains.py
0005_auto__add_field_userprofile_currency.py
Note that I have two duplicate 0005 migrations. These ran fine, and deployed fine on my production system.
$ python manage.py migrate accounts --list [17:11:42]
accounts
(*) 0001_initial
(*) 0002_auto__add_field_userprofile_telephone__add_field_userprofile_timezone
(*) 0003_auto
(*) 0004_auto__del_field_organisation_admin
(*) 0005_auto__add_field_organisation_permitted_domains
(*) 0005_auto__add_field_userprofile_currency
My table has the correct columns:
$ psql
db_my_project=# \d+ accounts_organisation
db_my_project=# \d+ accounts_userprofile
... shows currency and permitted_domain, suggesting the migrations worked correctly
However, if I try to create a new migration, South thinks that I haven't added the column' permitted_domains' to my model:
$ python manage.py schemamigration accounts --auto [17:16:15]
+ Added field permitted_domains on accounts.Organisation
Created 0006_auto__add_field_organisation_permitted_domains.py. You can now apply this migration with: ./manage.py migrate accounts
How do I fix this?