Skip to content

Instantly share code, notes, and snippets.

@jasonferrier
Created April 25, 2012 23:25
Show Gist options
  • Save jasonferrier/2494415 to your computer and use it in GitHub Desktop.
Save jasonferrier/2494415 to your computer and use it in GitHub Desktop.
migration issue
[2168][jasonferrier.jlfMBP: tntsite][master]$ 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
FATAL ERROR - The following SQL query failed: SELECT AddGeometryColumn('tnt_trailhead', 'location', 4326, 'POINT', 2);
The error was: permission denied for relation spatial_ref_sys
CONTEXT: SQL statement "SELECT SRID FROM spatial_ref_sys WHERE SRID = new_srid"
PL/pgSQL function "addgeometrycolumn" line 75 at SQL statement
SQL statement "SELECT AddGeometryColumn('','',$1,$2,$3,$4,$5)"
PL/pgSQL function "addgeometrycolumn" line 5 at SQL statement
! Error found during real run of migration! Aborting.
! Since you have a database that does not support running
! schema-altering statements in transactions, we have had
! to leave it in an interim state between migrations.
! You *might* be able to recover with: = DROP TABLE "tnt_userprofile" CASCADE; []
= DROP TABLE "tnt_agency" CASCADE; []
= DROP TABLE "tnt_park" CASCADE; []
= DROP TABLE "tnt_trailheadfeature" CASCADE; []
= DROP TABLE "tnt_trailhead" CASCADE; []
= DROP TABLE "tnt_trailhead_features" CASCADE; []
= DROP TABLE "tnt_campgroundfeature" CASCADE; []
= DROP TABLE "tnt_campground" CASCADE; []
= DROP TABLE "tnt_campground_features" CASCADE; []
= DROP TABLE "tnt_tripactivity" CASCADE; []
= DROP TABLE "tnt_tripfeature" CASCADE; []
= DROP TABLE "tnt_trip" CASCADE; []
= DROP TABLE "tnt_trip_features" CASCADE; []
= DROP TABLE "tnt_trip_people" CASCADE; []
! The South developers regret this has happened, and would
! like to gently persuade you to consider a slightly
! easier-to-deal-with DBMS (one that supports DDL transactions)
! NOTE: The error which caused the migration to fail is further up.
Error in migration: tnt:0001_initial
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 107, in run
return self.run_migration(migration)
File "/Library/Python/2.7/site-packages/South-0.7.4-py2.7.egg/south/migration/migrators.py", line 82, in run_migration
south.db.db.execute_deferred_sql()
File "/Library/Python/2.7/site-packages/South-0.7.4-py2.7.egg/south/db/generic.py", line 303, in execute_deferred_sql
self.execute(sql)
File "/Library/Python/2.7/site-packages/South-0.7.4-py2.7.egg/south/db/generic.py", line 264, in execute
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)
django.db.utils.DatabaseError: permission denied for relation spatial_ref_sys
CONTEXT: SQL statement "SELECT SRID FROM spatial_ref_sys WHERE SRID = new_srid"
PL/pgSQL function "addgeometrycolumn" line 75 at SQL statement
SQL statement "SELECT AddGeometryColumn('','',$1,$2,$3,$4,$5)"
PL/pgSQL function "addgeometrycolumn" line 5 at SQL statement
[2169][jasonferrier.jlfMBP: tntsite][master]$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment