Skip to content

Commit

Permalink
feat: add a AUTO_INCREMENT field in model
Browse files Browse the repository at this point in the history
  • Loading branch information
XadillaX committed Feb 29, 2016
1 parent e891d6e commit cb8a871
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var Model = function(name, toshihiko, fields, options) {
var self = this;

this.primaryKeys = [];
this.ai = null;

this.name = name;
this.toshihiko = toshihiko;
Expand Down Expand Up @@ -55,6 +56,8 @@ var Model = function(name, toshihiko, fields, options) {
self._fieldsKeyMap.name[f.name] = f;
self._fieldsKeyMap.column[f.column] = f;

if(f.autoIncrement) self.ai = f;

return f;
});

Expand Down

0 comments on commit cb8a871

Please sign in to comment.