Fix the createDatabase option
This commit is contained in:
parent
0bec94965c
commit
7344088cc6
|
@ -57,6 +57,9 @@ exports.initialize = function initializeDataSource(dataSource, callback) {
|
||||||
// Take other options for mysql driver
|
// Take other options for mysql driver
|
||||||
// See https://github.com/strongloop/loopback-connector-mysql/issues/46
|
// See https://github.com/strongloop/loopback-connector-mysql/issues/46
|
||||||
for (var p in s) {
|
for (var p in s) {
|
||||||
|
if (p === 'database' && s.createDatabase) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (options[p] === undefined) {
|
if (options[p] === undefined) {
|
||||||
options[p] = s[p];
|
options[p] = s[p];
|
||||||
}
|
}
|
||||||
|
@ -149,7 +152,7 @@ MySQL.prototype.query = function (sql, callback) {
|
||||||
connection.query(sql, function (err, data) {
|
connection.query(sql, function (err, data) {
|
||||||
if (debugEnabled) {
|
if (debugEnabled) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error('Error: ', err);
|
console.error('Error: %j', err);
|
||||||
}
|
}
|
||||||
debug('Data: ', data);
|
debug('Data: ', data);
|
||||||
}
|
}
|
||||||
|
@ -655,7 +658,7 @@ MySQL.prototype.autoupdate = function (models, cb) {
|
||||||
|
|
||||||
function done(err) {
|
function done(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(err);
|
console.error('%j', err);
|
||||||
}
|
}
|
||||||
if (--wait === 0 && cb) {
|
if (--wait === 0 && cb) {
|
||||||
cb();
|
cb();
|
||||||
|
|
Loading…
Reference in New Issue