Skip to content

Instantly share code, notes, and snippets.

@jasonferrier
Created May 9, 2012 19:00
Show Gist options
  • Save jasonferrier/2648015 to your computer and use it in GitHub Desktop.
Save jasonferrier/2648015 to your computer and use it in GitHub Desktop.
migration issues
jlfMBP:tntsite postgres$ python manage.py migrate tnt
/Users/jasonferrier/Sites/transitandtrails/tntsite/tnt/migrations/0019_auto__add_field_userprofile_api_secret__add_field_userprofile_api_key.py:9: SyntaxWarning: import * only allowed at module level
def forwards(self, orm):
Running migrations for tnt:
- Migrating forwards to 0052_auto__del_field_campground_bathrooms__del_field_campground_county__del.
> tnt:0001_initial
> tnt:0002_auto__add_transitrouter__add_transitagency
> tnt:0003_auto__add_field_trip_geom
> tnt:0004_auto__add_field_park_slug
> tnt:0005_auto__add_field_park_geom
> tnt:0006_auto__add_cpadparks
> tnt:0007_auto__add_cpadunits
> tnt:0008_auto__add_field_cpadunits_slug
> tnt:0009_auto__chg_field_cpadunits_slug
> tnt:0010_auto__add_cpadsuperunit
> tnt:0011_auto__add_cpadholding
> tnt:0012_auto__add_cpadunit
> tnt:0013_auto__add_field_cpadsuperunit_slug
> tnt:0014_auto__del_unique_cpadsuperunit_slug
> tnt:0015_auto__del_cpadunits__del_cpadparks
> tnt:0016_auto
> tnt:0017_auto__add_field_cpadunit_unit_slug__add_field_cpadunit_county_slug
> tnt:0018_auto__add_field_trailhead_author
> tnt:0019_auto__add_field_userprofile_api_secret__add_field_userprofile_api_key
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settings)
File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 459, in execute_manager
utility.execute()
File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/Library/Python/2.7/site-packages/South-0.7.4-py2.7.egg/south/management/commands/migrate.py", line 107, in handle
ignore_ghosts = ignore_ghosts,
File "/Library/Python/2.7/site-packages/South-0.7.4-py2.7.egg/south/migration/__init__.py", line 219, in migrate_app
success = migrator.migrate_many(target, workplan, database)
File "/Library/Python/2.7/site-packages/South-0.7.4-py2.7.egg/south/migration/migrators.py", line 235, in migrate_many
result = migrator.__class__.migrate_many(migrator, target, migrations, database)
File "/Library/Python/2.7/site-packages/South-0.7.4-py2.7.egg/south/migration/migrators.py", line 310, in migrate_many
result = self.migrate(migration, database)
File "/Library/Python/2.7/site-packages/South-0.7.4-py2.7.egg/south/migration/migrators.py", line 133, in migrate
result = self.run(migration)
File "/Library/Python/2.7/site-packages/South-0.7.4-py2.7.egg/south/migration/migrators.py", line 106, in run
dry_run.run_migration(migration)
File "/Library/Python/2.7/site-packages/South-0.7.4-py2.7.egg/south/migration/migrators.py", line 191, in run_migration
self._run_migration(migration)
File "/Library/Python/2.7/site-packages/South-0.7.4-py2.7.egg/south/migration/migrators.py", line 178, in _run_migration
raise exceptions.FailedDryRun(migration, sys.exc_info())
south.exceptions.FailedDryRun: ! Error found during dry run of '0019_auto__add_field_userprofile_api_secret__add_field_userprofile_api_key'! Aborting.
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/South-0.7.4-py2.7.egg/south/migration/migrators.py", line 175, in _run_migration
migration_function()
File "/Library/Python/2.7/site-packages/South-0.7.4-py2.7.egg/south/migration/migrators.py", line 57, in <lambda>
return (lambda: direction(orm))
File "/Users/jasonferrier/Sites/transitandtrails/tntsite/tnt/migrations/0019_auto__add_field_userprofile_api_secret__add_field_userprofile_api_key.py", line 18, in forwards
set_user_profile_api_keys()
File "/Users/jasonferrier/Sites/transitandtrails/tntsite/tnt/models.py", line 66, in set_user_profile_api_keys
for profile in UserProfile.objects.all():
File "/Library/Python/2.7/site-packages/django/db/models/query.py", line 118, in _result_iter
self._fill_cache()
File "/Library/Python/2.7/site-packages/django/db/models/query.py", line 875, in _fill_cache
self._result_cache.append(self._iter.next())
File "/Library/Python/2.7/site-packages/django/db/models/query.py", line 291, in iterator
for row in compiler.results_iter():
File "/Library/Python/2.7/site-packages/django/db/models/sql/compiler.py", line 763, in results_iter
for rows in self.execute_sql(MULTI):
File "/Library/Python/2.7/site-packages/django/db/models/sql/compiler.py", line 818, in execute_sql
cursor.execute(sql, params)
File "/Library/Python/2.7/site-packages/django/db/backends/util.py", line 40, in execute
return self.cursor.execute(sql, params)
File "/Library/Python/2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 52, in execute
return self.cursor.execute(query, args)
DatabaseError: column tnt_userprofile.api_key does not exist
LINE 1: ...tnt_userprofile"."zip", "tnt_userprofile"."beta", "tnt_userp...
^
jlfMBP:tntsite postgres$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment