Permalink
Browse files

feat: add a AUTO_INCREMENT field in model

  • Loading branch information...
XadillaX committed Feb 29, 2016
1 parent e891d6e commit cb8a87176f3763bb0b27ae452e165da0d2bbc83e
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/model.js
@@ -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;
@@ -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;
});

0 comments on commit cb8a871

Please sign in to comment.