Skip to content

Instantly share code, notes, and snippets.

@dhrp
Created June 6, 2013 23:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhrp/5726009 to your computer and use it in GitHub Desktop.
Save dhrp/5726009 to your computer and use it in GitHub Desktop.
failed migration
(2.6)dotcloud@rtfd4-default-www-0:~/current/readthedocs$ ./manage.py migrate --settings=settings.dotcloud
/opt/ve/2.6/lib/python2.6/site-packages/django/conf/__init__.py:75: DeprecationWarning: The ADMIN_MEDIA_PREFIX setting has been removed; use STATIC_URL instead.
"use STATIC_URL instead.", DeprecationWarning)
[06/Jun/2013 18:45:35] WARNING [tastyapi.slum:16] SLUMBER_USERNAME/PASSWORD settings are not set
Running migrations for guardian:
- Nothing to migrate.
- Loading initial data for guardian.
Installed 0 object(s) from 0 fixture(s)
Running migrations for djcelery:
- Nothing to migrate.
- Loading initial data for djcelery.
Installed 0 object(s) from 0 fixture(s)
Running migrations for tastypie:
- Nothing to migrate.
- Loading initial data for tastypie.
Installed 0 object(s) from 0 fixture(s)
Running migrations for projects:
- Migrating forwards to 0033_add_languages.
> projects:0029_add_version_to_imported_file
[06/Jun/2013 18:45:36] DEBUG [south:270] execute "ALTER TABLE "projects_importedfile" ADD COLUMN "version_id" integer NULL;" with params "[]"
[06/Jun/2013 18:45:36] DEBUG [south:270] execute "ALTER TABLE "projects_importedfile" ALTER COLUMN "version_id" TYPE integer, ALTER COLUMN "version_id" DROP NOT NULL, ALTER COLUMN "version_id" DROP DEFAULT;" with params "[]"
[06/Jun/2013 18:45:36] DEBUG [south:270] execute "ALTER TABLE "projects_importedfile" ADD CONSTRAINT "version_id_refs_id_2af43ffa419218f1" FOREIGN KEY ("version_id") REFERENCES "builds_version" ("id") DEFERRABLE INITIALLY DEFERRED;" with params "[]"
FATAL ERROR - The following SQL query failed: ALTER TABLE "projects_importedfile" ADD CONSTRAINT "version_id_refs_id_2af43ffa419218f1" FOREIGN KEY ("version_id") REFERENCES "builds_version" ("id") DEFERRABLE INITIALLY DEFERRED;
The error was: relation "builds_version" does not exist
Error in migration: projects:0029_add_version_to_imported_file
Traceback (most recent call last):
File "./manage.py", line 5, in <module>
execute_manager(settings.sqlite)
File "/opt/ve/2.6/lib/python2.6/site-packages/django/core/management/__init__.py", line 459, in execute_manager
utility.execute()
File "/opt/ve/2.6/lib/python2.6/site-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/ve/2.6/lib/python2.6/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/opt/ve/2.6/lib/python2.6/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/opt/ve/2.6/lib/python2.6/site-packages/south/management/commands/migrate.py", line 108, in handle
ignore_ghosts = ignore_ghosts,
File "/opt/ve/2.6/lib/python2.6/site-packages/south/migration/__init__.py", line 213, in migrate_app
success = migrator.migrate_many(target, workplan, database)
File "/opt/ve/2.6/lib/python2.6/site-packages/south/migration/migrators.py", line 235, in migrate_many
result = migrator.__class__.migrate_many(migrator, target, migrations, database)
File "/opt/ve/2.6/lib/python2.6/site-packages/south/migration/migrators.py", line 310, in migrate_many
result = self.migrate(migration, database)
File "/opt/ve/2.6/lib/python2.6/site-packages/south/migration/migrators.py", line 133, in migrate
result = self.run(migration)
File "/opt/ve/2.6/lib/python2.6/site-packages/south/migration/migrators.py", line 107, in run
return self.run_migration(migration)
File "/opt/ve/2.6/lib/python2.6/site-packages/south/migration/migrators.py", line 82, in run_migration
south.db.db.execute_deferred_sql()
File "/opt/ve/2.6/lib/python2.6/site-packages/south/db/generic.py", line 309, in execute_deferred_sql
self.execute(sql)
File "/opt/ve/2.6/lib/python2.6/site-packages/south/db/generic.py", line 273, in execute
cursor.execute(sql, params)
File "/opt/ve/2.6/lib/python2.6/site-packages/django/db/backends/util.py", line 40, in execute
return self.cursor.execute(sql, params)
File "/opt/ve/2.6/lib/python2.6/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 52, in execute
return self.cursor.execute(query, args)
django.db.utils.DatabaseError: relation "builds_version" does not exist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment