diff --git a/lib/sql.js b/lib/sql.js index 46e71c3..01eb160 100644 --- a/lib/sql.js +++ b/lib/sql.js @@ -1877,7 +1877,7 @@ SQLConnector.prototype.getArgs = function(table, options, cb) { SQLConnector.prototype.discoverModelProperties = function(table, options, cb) { var self = this; var args = self.getArgs(table, options, cb); - var schema = args.schema; + var schema = args.schema || args.owner; table = args.table; options = args.options; @@ -1927,7 +1927,7 @@ SQLConnector.prototype.buildQueryPrimaryKeys = function(schema, table) { SQLConnector.prototype.discoverPrimaryKeys = function(table, options, cb) { var self = this; var args = self.getArgs(table, options, cb); - var schema = args.schema; + var schema = args.schema || args.owner; if (typeof(self.getDefaultSchema) === 'function' && !schema) { schema = self.getDefaultSchema(); @@ -1961,7 +1961,7 @@ SQLConnector.prototype.buildQueryForeignKeys = function(schema, table) { SQLConnector.prototype.discoverForeignKeys = function(table, options, cb) { var self = this; var args = self.getArgs(table, options, cb); - var schema = args.schema; + var schema = args.schema || args.owner; if (typeof(self.getDefaultSchema) === 'function' && !schema) { schema = self.getDefaultSchema(); @@ -1998,7 +1998,7 @@ SQLConnector.prototype.buildQueryExportedForeignKeys = function(schema, table) { SQLConnector.prototype.discoverExportedForeignKeys = function(table, options, cb) { var self = this; var args = self.getArgs(table, options, cb); - var schema = args.schema; + var schema = args.schema || args.owner; if (typeof(self.getDefaultSchema) === 'function' && !schema) { schema = self.getDefaultSchema();