1. Andrew Godwin
  2. south
  3. Pull requests

Pull requests

#11 Merged at 7b461ce
Repository
msabramo
Branch
output_failing_sql
Repository
andrewgodwin
Branch
default

Print the failing SQL when a query fails

Author
  1. Marc Abramowitz
Reviewers
Description

Before:

django migrate publisher

Running migrations for publisher: - Migrating forwards to 201110041321_auto__add_field_schedule_tag.

publisher:201110041321_auto__add_field_schedule_tag Traceback (most recent call last): ... File "/home/buildbot/django_env/lib/python2.7/site-packages/South-0.7.3-py2.7.egg/south/db/generic.py", line 150, in execute cursor.execute(sql, params) File "/home/buildbot/django_env/lib/python2.7/site-packages/django/db/backends/util.py", line 34, in execute return self.cursor.execute(sql, params) File "/home/buildbot/django_env/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 44, in execute return self.cursor.execute(query, args) django.db.utils.DatabaseError: cannot ALTER TABLE "schedule" because it has pending trigger events

After:

django migrate publisher

Running migrations for publisher: - Migrating forwards to 201110041321_auto__add_field_schedule_tag.

publisher:201110041321_auto__add_field_schedule_tag FATAL ERROR - The following SQL query failed: ALTER TABLE "schedule" ADD CONSTRAINT "tag_id_refs_tag_id_95bd8ba67487e71" FOREIGN KEY ("tag_id") REFERENCES "tag" ("tag_id") DEFERRABLE INITIALLY DEFERRED; The error was: cannot ALTER TABLE "schedule" because it has pending trigger events

Comments (2)