Skip to content

Commit

Permalink
Merge pull request #121 from mrcsparker/master
Browse files Browse the repository at this point in the history
Added date type for sqlite3
  • Loading branch information
kunklejr committed Sep 13, 2013
2 parents 3ceb865 + 5df39d5 commit 50db8b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/data_type.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = {
BIG_INTEGER: 'bigint',
REAL: 'real',
DATE_TIME: 'datetime',
TIME: 'time',
BLOB: 'blob',
TIMESTAMP: 'timestamp',
BINARY: 'binary',
Expand Down
10 changes: 10 additions & 0 deletions lib/driver/sqlite3.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ var Sqlite3Driver = Base.extend({
this.connection = connection;
},

mapDataType: function(str) {
switch(str) {
case type.DATE_TIME:
return 'datetime';
case type.TIME:
return 'time';
}
return this._super(str);
},

createColumnConstraint: function(spec, options) {
var constraint = [];
if (spec.primaryKey && options.emitPrimaryKey) {
Expand Down

0 comments on commit 50db8b4

Please sign in to comment.