First time here? Check out the FAQ!

migrate error while upgrading askbot

FATAL ERROR - The following SQL query failed: CREATE TABLE "robots_url" ("id" serial NOT NULL PRIMARY KEY, "pattern" varchar(255) NOT NULL); The error was: relation "robots_url" already exists

Error in migration: robots:0001_initial Traceback (most recent call last): File "", line 11, in <module> execute_manager(settings) File "/home/jqy/lib/python2.7/Django-1.4.3-py2.7.egg/django/core/management/", line 438, in execute_manager utility.execute() File "/home/jqy/lib/python2.7/Django-1.4.3-py2.7.egg/django/core/management/", line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/jqy/lib/python2.7/Django-1.4.3-py2.7.egg/django/core/management/", line 191, in run_from_argv self.execute(args, *options.__dict__) File "/home/jqy/lib/python2.7/Django-1.4.3-py2.7.egg/django/core/management/", line 220, in execute output = self.handle(args, *options) File "/home/jqy/lib/python2.7/South-0.7.6-py2.7.egg/south/management/commands/", line 108, in handle ignore_ghosts = ignore_ghosts, File "/home/jqy/lib/python2.7/South-0.7.6-py2.7.egg/south/migration/", line 213, in migrate_app success = migrator.migrate_many(target, workplan, database) File "/home/jqy/lib/python2.7/South-0.7.6-py2.7.egg/south/migration/", line 235, in migrate_many result = migrator.__class__.migrate_many(migrator, target, migrations, database) File "/home/jqy/lib/python2.7/South-0.7.6-py2.7.egg/south/migration/", line 310, in migrate_many result = self.migrate(migration, database) File "/home/jqy/lib/python2.7/South-0.7.6-py2.7.egg/south/migration/", line 133, in migrate result = File "/home/jqy/lib/python2.7/South-0.7.6-py2.7.egg/south/migration/", line 107, in run return self.run_migration(migration) File "/home/jqy/lib/python2.7/South-0.7.6-py2.7.egg/south/migration/", line 81, in run_migration migration_function() File "/home/jqy/lib/python2.7/South-0.7.6-py2.7.egg/south/migration/", line 57, in <lambda> return (lambda: direction(orm)) File "/home/jqy/lib/python2.7/django_robots-0.9.1-py2.7.egg/robots/migrations/", line 13, in forwards ('pattern','django.db.models.fields.CharField')(max_length=255)), File "/home/jqy/lib/python2.7/South-0.7.6-py2.7.egg/south/db/", line 44, in _cache_clear return func(self, table, args, *opts) File "/home/jqy/lib/python2.7/South-0.7.6-py2.7.egg/south/db/", line 352, in create_table ', '.join([col for col in columns if col]), File "/home/jqy/lib/python2.7/South-0.7.6-py2.7.egg/south/db/", line 273, in execute cursor.execute(sql, params) File "/home/jqy/lib/python2.7/Django-1.4.3-py2.7.egg/django/db/backends/", line 34, in execute return self.cursor.execute(sql, params) File "/home/jqy/lib/python2.7/Django-1.4.3-py2.7.egg/django/db/backends/postgresql_psycopg2/", line 44, in execute return self.cursor.execute(query, args) django.db.utils.DatabaseError: relation "robots_url" already exists

so how to ... (more)

jqy3222089's avatar
asked 2013-02-09 11:38:41 -0500
edit flag offensive 0 remove flag close merge delete


add a comment see more comments

1 Answer


Here's how I managed to get past this error:

  • Run python migrate --fake to see which migrations need to take place.
  • For each migration, run python migrate appname .

That seemed to fix things; I can now do full migrations without incident.

mcg's avatar
answered 2014-11-24 14:43:58 -0500, updated 2014-11-24 14:48:47 -0500
edit flag offensive 0 remove flag delete link


add a comment see more comments