Skip to content

Commit 41a2afe

Browse files
committed
use "owner" instead of "schema" for discovered results
1 parent e714de5 commit 41a2afe

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/discovery.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function mixinDiscovery(MySQL, mysql) {
6767
'table_schema, table_name', options);
6868
} else if (schema) {
6969
sqlTables = paginateSQL('SELECT \'table\' AS "type",' +
70-
' table_name AS "name", table_schema AS "schema"' +
70+
' table_name AS "name", table_schema AS "owner"' +
7171
' FROM information_schema.tables' +
7272
' WHERE table_schema=' + mysql.escape(schema),
7373
'table_schema, table_name', options);

test/mysql.discover.test.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ describe('discoverModels', function() {
6969
var views = false;
7070
assert(models.length > 0, 'some models returned');
7171
models.forEach(function(m) {
72-
assert.equal(m.schema.toLowerCase(), config.database.toLowerCase());
72+
assert.equal(m.owner.toLowerCase(), config.database.toLowerCase());
7373
});
7474
done(null, models);
7575
}
@@ -112,6 +112,7 @@ describe('Discover models including other users', function() {
112112
var others = false;
113113
assert.equal(3, models.length);
114114
models.forEach(function(m) {
115+
assert(m.owner);
115116
if (m.owner !== 'STRONGLOOP') {
116117
others = true;
117118
}

0 commit comments

Comments
 (0)