Andrew Godwin avatar Andrew Godwin committed c151165

Print db-dry-run SQL

Comments (0)

Files changed (1)

south/migration.py

             if not db.has_ddl_transactions or db_dry_run:
                 if not (hasattr(klass, "no_dry_run") and klass.no_dry_run):
                     db.dry_run = True
-                    db.debug, old_debug = False, db.debug
+                    # Only hide SQL if this is an automatic dry run.
+                    if not db.has_ddl_transactions:
+                        db.debug, old_debug = False, db.debug
                     pending_creates = db.get_pending_creates()
                     db.start_transaction()
                     try:
                         traceback.print_exc()
                         print " ! Error found during dry run of migration! Aborting."
                         return False
-                    db.debug = old_debug
+                    if not db.has_ddl_transactions:
+                        db.debug = old_debug
                     db.clear_run_data(pending_creates)
                     db.dry_run = False
                 elif db_dry_run:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.