Fix the createDatabase option

This commit is contained in:
Raymond Feng 2014-08-19 16:36:33 -07:00
parent 0bec94965c
commit 7344088cc6
1 changed files with 5 additions and 2 deletions

View File

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