diff --git a/lib/adapters/sql/mysql.js b/lib/adapters/sql/mysql.js index ec469362..947c2b9c 100644 --- a/lib/adapters/sql/mysql.js +++ b/lib/adapters/sql/mysql.js @@ -167,7 +167,7 @@ utils.mixin(Adapter.prototype, new (function () { , sql = ''; items.forEach(function (item) { - var statement = self._createInsertStatement(item, props); + var statement = self._createInsertStatement(item, props, model.autoIncrementId); sql += statement; }); @@ -182,6 +182,7 @@ utils.mixin(Adapter.prototype, new (function () { item._saved = true; } if (data instanceof model.ModelBase) { + data.id = res.insertId; callback(null, data); } else {