Permalink
Browse files

Add BIGINT data type. Closes #81

  • Loading branch information...
1 parent 561c0ce commit 8bc8f093d39ee8e313253f679db113c6f33166c2 @kunklejr kunklejr committed Mar 6, 2013
Showing with 4 additions and 12 deletions.
  1. +1 −0 lib/data_type.js
  2. +2 −0 lib/driver/base.js
  3. +1 −12 lib/driver/mysql.js
View
@@ -2,6 +2,7 @@ module.exports = {
STRING: 'string',
TEXT: 'text',
INTEGER: 'int',
+ BIG_INTEGER: 'bigint',
REAL: 'real',
DATE_TIME: 'datetime',
BLOB: 'blob',
View
@@ -24,6 +24,8 @@ module.exports = Base = Class.extend({
return 'TEXT';
case type.INTEGER:
return 'INTEGER';
+ case type.BIG_INTEGER:
+ return 'BIGINT';
case type.DATE_TIME:
return 'INTEGER';
case type.REAL:
View
@@ -14,8 +14,6 @@ var MysqlDriver = Base.extend({
mapDataType: function(spec) {
var len;
switch(spec.type) {
- case type.STRING:
- return 'VARCHAR';
case type.TEXT:
len = parseInt(spec.length) || 1000;
if(len > 16777216) {
@@ -28,12 +26,8 @@ var MysqlDriver = Base.extend({
return 'TEXT';
}
return 'TINYTEXT';
- case type.INTEGER:
- return 'INTEGER';
case type.DATE_TIME:
return 'DATETIME';
- case type.REAL:
- return 'REAL';
case type.BLOB:
len = parseInt(spec.length) || 1000;
if(len > 16777216) {
@@ -46,15 +40,10 @@ var MysqlDriver = Base.extend({
return 'BLOB';
}
return 'TINYBLOB';
- case type.TIMESTAMP:
- return 'TIMESTAMP';
- case type.BINARY:
- return 'BINARY';
case type.BOOLEAN:
return 'TINYINT(1)';
- default:
- throw new Error('Invalid data type ' + spec.type);
}
+ return this._super(str);
},
createColumnDef: function(name, spec, options) {

0 comments on commit 8bc8f09

Please sign in to comment.