Ask Your Question

migrate error while upgrading askbot

asked 2013-02-09 11:38:41 -0500

jqy3222089 gravatar image

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)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-11-24 14:43:58 -0500

mcg gravatar image

updated 2014-11-24 14:48:47 -0500

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-02-09 11:38:41 -0500

Seen: 226 times

Last updated: Nov 24 '14