MegaMark16/django-cms-themes

Can't migrate after installing cms_themes

Closed this issue · 2 comments

I just installed django-cms-themes and added it to my installed apps. When I run

python manage.py migrate I get:

Traceback (most recent call last):
File "manage.py", line 14, in
execute_manager(settings)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 459, in execute_manager
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(_args, *_options.dict)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 232, in execute
output = self.handle(_args, *_options)
File "/usr/local/lib/python2.7/dist-packages/south/management/commands/migrate.py", line 108, in handle
ignore_ghosts = ignore_ghosts,
File "/usr/local/lib/python2.7/dist-packages/south/migration/init.py", line 193, in migrate_app
applied_all = check_migration_histories(applied_all, delete_ghosts, ignore_ghosts)
File "/usr/local/lib/python2.7/dist-packages/south/migration/init.py", line 72, in check_migration_histories
for h in histories:
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 118, in _result_iter
self._fill_cache()
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 892, in _fill_cache
self._result_cache.append(self._iter.next())
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 291, in iterator
for row in compiler.results_iter():
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 763, in results_iter
for rows in self.execute_sql(MULTI):
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 818, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py", line 40, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/base.py", line 52, in execute
return self.cursor.execute(query, args)
django.db.utils.DatabaseError: current transaction is aborted, commands ignored until end of transaction block

If I take out cms_themes, everything works fine.

My pip freeze is as follows:

Django==1.4.3
GnuPGInterface==0.3.2
Jinja2==2.6
M2Crypto==0.21.1
Mako==0.5.0
Markdown==2.1.1
MarkupSafe==0.15
PAM==0.4.2
PIL==1.1.7
PyYAML==3.10
Pygments==1.4
South==0.7.6
Twisted-Core==11.1.0
Twisted-Names==11.1.0
Twisted-Web==11.1.0
adium-theme-ubuntu==0.3.2
apt-xapian-index==0.44
apturl==0.5.1ubuntu3
argparse==1.2.1
biplist==0.5
chardet==2.0.1
command-not-found==0.2.44
configglue==1.0
configobj==4.7.2
debtagshw==0.1
decorator==3.3.2
defer==1.0.2
dirspec==3.0.0
distribute==0.6.35
django-classy-tags==0.4
django-cms==2.3.5
django-cms-themes==1.0.10
django-dumpdb==0.1
django-extensions==1.1.1
django-filer==0.9.3
django-mptt==0.5.2
django-polymorphic==0.3.1
django-reversion==1.6.5
django-sekizai==0.7
django-tastypie==0.9.12

Any idea what might be going on?

I hunted this down to the following SQL statement.

2013-03-26 15:12:14 PDT LOG: statement: SELECT "cms_themes_theme"."id", "cms_themes_theme"."name", "cms_themes_theme"."theme_file" FROM "cms_themes_theme" INNER JOIN "cms_themes_theme_sites" ON ("cms_themes_theme"."id" = "cms_themes_theme_sites"."theme_id") WHERE "cms_themes_theme_sites"."site_id" = 1
2013-03-26 15:12:14 PDT ERROR: relation "cms_themes_theme" does not exist at character 97

I'm trying to setup this up for the first time so the table cms_themes_theme has not yet been created. Any thoughts?

My workaround was to run migration with an empty models.py file and then restore the original models.py.