openplans / openblock

OpenBlock is a web application and RESTful service that allows users to browse and search their local area for "hyper-local news
61 stars 26 forks source link

custom sql loading fails to re-execute during syncdb #108

Closed slinkp closed 11 years ago

slinkp commented 11 years ago

I think this custom sql that is now a post-sync call fails if you run syncdb again

(openblock)ltucker:src ltucker$ django-admin.py syncdb
Loading extra post-syncdb SQL data from '/Users/ltucker/devel/openblock/src/openblock/ebpub/ebpub/db/sql/location_post_syncdb.sql'
Failed to install post-syncdb SQL file '/Users/ltucker/devel/openblock/src/openblock/ebpub/ebpub/db/sql/location_post_syncdb.sql': trigger "set_loc_area" for relation "db_location" already exists

Traceback (most recent call last):
  File "/Users/ltucker/devel/openblock/src/openblock/ebpub/ebpub/db/management.py", line 55, in location_post_syncdb_callback
    cursor.execute(sql)
  File "/Users/ltucker/devel/openblock/src/django/django/db/backends/util.py", line 15, in execute
    return self.cursor.execute(sql, params)
  File "/Users/ltucker/devel/openblock/src/django/django/db/backends/postgresql_psycopg2/base.py", line 44, in execute
    return self.cursor.execute(query, args)
DatabaseError: trigger "set_loc_area" for relation "db_location" already exists
slinkp commented 11 years ago

obsolete now that we're using South.

slinkp commented 11 years ago

Ticket imported from Trac: http://developer.openblockproject.org/ticket/108 Reported by: ltucker