Skip to content

Commit

Permalink
Fix error ids from addMany method, fix #388
Browse files Browse the repository at this point in the history
  • Loading branch information
welefen committed Aug 3, 2016
1 parent 298d44e commit cd414b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/config/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
export default {
redis: '2.3.0',
sqlite3: '3.1.1',
sqlite3: '3.1.4',
ejs: '2.3.4',
jade: '1.11.0',
mongodb: '2.0.48',
Expand Down
3 changes: 3 additions & 0 deletions src/model/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ export default class extends Base {
let insertIds = [];
promises = data.map((item, i) => {
let id = insertId + i;
if(this.config.type === 'sqlite'){
id = insertId - data.length + i + 1;
}
item[this.pk] = id;
insertIds.push(id);
return this.afterAdd(item, options);
Expand Down

0 comments on commit cd414b2

Please sign in to comment.