loopback-connector-mysql
Advanced tools
Comparing version 1.5.0 to 1.5.1
@@ -0,1 +1,19 @@ | ||
2015-01-15, Version 1.5.1 | ||
========================= | ||
* Fix the loop of models (Raymond Feng) | ||
* Set ok default to false (Geoffroy Lesage) | ||
* Fixed missing 'ok' (Geoffroy Lesage) | ||
* Changed default type mapping (Geoffroy Lesage) | ||
* Fixed isActual syntax to accept optional model arg (Geoffroy Lesage) | ||
* Fixed isActual implemenation (Geoffroy Lesage) | ||
* Inherit Schema From DataSource if not defined (Serkan Serttop) | ||
2015-01-09, Version 1.5.0 | ||
@@ -2,0 +20,0 @@ ========================= |
@@ -180,2 +180,5 @@ module.exports = mixinDiscovery; | ||
var owner = args.owner; | ||
if(!owner){ | ||
owner = inheritOwnerViaDataSource.call(this); | ||
} | ||
table = args.table; | ||
@@ -232,2 +235,5 @@ options = args.options; | ||
var owner = args.owner; | ||
if(!owner){ | ||
owner = inheritOwnerViaDataSource.call(this); | ||
} | ||
table = args.table; | ||
@@ -274,2 +280,5 @@ options = args.options; | ||
var owner = args.owner; | ||
if(!owner){ | ||
owner = inheritOwnerViaDataSource.call(this); | ||
} | ||
table = args.table; | ||
@@ -318,2 +327,5 @@ options = args.options; | ||
var owner = args.owner; | ||
if(!owner){ | ||
owner = inheritOwnerViaDataSource.call(this); | ||
} | ||
table = args.table; | ||
@@ -373,2 +385,9 @@ options = args.options; | ||
} | ||
function inheritOwnerViaDataSource(){ | ||
if(this.dataSource && this.dataSource.settings && this.dataSource.settings.database){ | ||
return this.dataSource.settings.database; | ||
} | ||
return undefined; | ||
} | ||
} |
@@ -693,6 +693,18 @@ /*! | ||
*/ | ||
MySQL.prototype.isActual = function(cb) { | ||
MySQL.prototype.isActual = function(models, cb) { | ||
var self = this; | ||
var ok = false; | ||
async.each(Object.keys(this._models), function(model, done) { | ||
if ((!cb) && ('function' === typeof models)) { | ||
cb = models; | ||
models = undefined; | ||
} | ||
// First argument is a model name | ||
if ('string' === typeof models) { | ||
models = [models]; | ||
} | ||
models = models || Object.keys(this._models); | ||
async.each(models, function(model, done) { | ||
var table = self.tableEscaped(model); | ||
@@ -1029,6 +1041,2 @@ self.query('SHOW FIELDS FROM ' + table, function(err, fields) { | ||
default: | ||
case 'String': | ||
dt = columnType(p, 'VARCHAR'); | ||
dt = stringOptionsByType(p, dt); | ||
break; | ||
case 'JSON': | ||
@@ -1041,2 +1049,6 @@ case 'Object': | ||
break; | ||
case 'String': | ||
dt = columnType(p, 'VARCHAR'); | ||
dt = stringOptionsByType(p, dt); | ||
break; | ||
case 'Number': | ||
@@ -1043,0 +1055,0 @@ dt = columnType(p, 'INT'); |
{ | ||
"name": "loopback-connector-mysql", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "MySQL connector for loopback-datasource-juggler", | ||
@@ -30,4 +30,4 @@ "main": "index.js", | ||
"optionalDependencies": { | ||
"sl-blip": "http://blip.strongloop.com/loopback-connector-mysql@1.5.0" | ||
"sl-blip": "http://blip.strongloop.com/loopback-connector-mysql@1.5.1" | ||
} | ||
} |
154309
2988