Andrew Godwin avatar Andrew Godwin committed efa93ec

Fix #510: Allow South to work on other schemas.

Comments (0)

Files changed (1)

south/db/generic.py

             ifsc_table = "constraint_column_usage"
         else:
             ifsc_table = "key_column_usage"
+            
+        if self._has_setting("SCHEMA"):
+            schema = self._get_setting("SCHEMA")
+        else:
+            schema = "public"
 
         # First, load all constraint->col mappings for this table.
         rows = self.execute("""
                 kc.table_schema = %%s AND
                 kc.table_name = %%s AND
                 c.constraint_type = %%s
-        """ % ifsc_table, ['public', table_name, type])
+        """ % ifsc_table, [schema, table_name, type])
         
         # Load into a dict
         mapping = {}
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.