Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add BIGINT data type. Closes #81

  • Loading branch information...
commit 8bc8f093d39ee8e313253f679db113c6f33166c2 1 parent 561c0ce
@kunklejr kunklejr authored
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
1  lib/data_type.js
@@ -2,6 +2,7 @@ module.exports = {
STRING: 'string',
TEXT: 'text',
INTEGER: 'int',
+ BIG_INTEGER: 'bigint',
REAL: 'real',
DATE_TIME: 'datetime',
BLOB: 'blob',
View
2  lib/driver/base.js
@@ -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
13 lib/driver/mysql.js
@@ -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) {
Please sign in to comment.
Something went wrong with that request. Please try again.