Commits

Andrew Godwin committed efa93ec

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

  • Participants
  • Parent commits 99da2b5

Comments (0)

Files changed (1)

File 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 = {}