I've just upgraded to Django 1.7 and so far everything is going swimmingly, with the exception that every single time I run migrate, it attempts to add the 'add_postgisgeometrycolumns' permission to the database, which causes an IntegrityError since it already exists. This error also occurs with the --no-initial-data flag as well. The migration was initally run with --fake and completed succesfully, but every subsequent migrate command (even when nothing has changed, so it would be a migrate that should produce no results) raises the same error.
As far as I can see the only place this would be coming from is django.contrib.gis. I'm sure this is just some silly error, probably on my part, but I can't figure it out. Any ideas?
python manage.py migrate
/app/.heroku/src/languages-plus/languages_plus/models.py:123: RemovedInDjango18Warning: `CultureCodeManager.get_query_set` method should be renamed `get_queryset`.
class CultureCodeManager(models.Manager, CultureCodeMixin):
System check identified some issues:
WARNINGS:
?: (1_6.W001) Some project unittests may not execute as expected.
HINT: Django 1.6 introduced a new default test runner. It looks like this project was generated using Django 1.5 or earlier. You should ensure your tests are all running & beha
Operations to perform:
Synchronize unmigrated apps: grappelli, reversion, storages, cacheops, compressor, raven_compat, djrill, crispy_forms, django_extensions, clear_cache, debug_toolbar, countries_plus,
analytical, django_reset, customer_portal, adv_cache_tag, djangobower, control_panel, collectfast, rosetta, modeltranslation, djangosecure, callingrates, autoslug, gis, customers, curr
encies, languages_plus
Apply all migrations: auth, pickup_locations, smartystreets, us_hotels, geonames_cities, carts, sales_tax, vendors, pricing, core, contenttypes, notifications, admin, orders, session
s
Synchronizing apps without migrations:
Creating tables...
Installing custom SQL...
Installing indexes...
Installed 252 object(s) from 1 fixture(s)
Installed 419 object(s) from 1 fixture(s)
Running migrations:
No migrations to apply.
Your models have changes that are not yet reflected in a migration, and so won't be applied.
Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
utility.execute()
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **options.__dict__)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
output = self.handle(*args, **options)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 164, in handle
emit_post_migrate_signal(created_models, self.verbosity, self.interactive, connection.alias)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/sql.py", line 268, in emit_post_migrate_signal
using=db)
File "/app/.heroku/python/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 198, in send
response = receiver(signal=self, sender=sender, **named)
File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py", line 114, in create_permissions
Permission.objects.using(using).bulk_create(perms)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/query.py", line 409, in bulk_create
self._batched_insert(objs_without_pk, fields, batch_size)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/query.py", line 938, in _batched_insert
using=self.db)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/manager.py", line 92, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/query.py", line 921, in _insert
return query.get_compiler(using=using).execute_sql(return_id)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 920, in execute_sql
cursor.execute(sql, params)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/utils.py", line 81, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/utils.py", line 65, in execute
return self.cursor.execute(sql, params)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/utils.py", line 65, in execute
return self.cursor.execute(sql, params)
django.db.utils.IntegrityError: duplicate key value violates unique constraint "auth_permission_content_type_id_codename_key"
DETAIL: Key (content_type_id, codename)=(50, add_postgisgeometrycolumns) already exists.