Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added MysqlDriver#mapDataType to override base's one.

  • Loading branch information...
commit 5f49bf7f422d380c1fa83e4da15d2e6ec1166f4a 1 parent b8bf9a7
@kichiro authored
Showing with 21 additions and 0 deletions.
  1. +21 −0 lib/driver/mysql.js
View
21 lib/driver/mysql.js
@@ -8,6 +8,27 @@ var MysqlDriver = Base.extend({
this._super();
this.connection = connection;
},
+
+ mapDataType: function(str) {
+ switch(str) {
+ case type.STRING:
+ return 'VARCHAR(255)';
+ case type.TEXT:
+ return 'TEXT';
+ case type.INTEGER:
+ return 'INT';
+ case type.DATE_TIME:
+ return 'DATETIME';
+ case type.REAL:
+ return 'REAL';
+ case type.BLOB:
+ return 'BLOB';
+ case type.BOOLEAN:
+ return 'INT(1)'
+ default:
+ throw new Error('Invalid data type ' + str);
+ }
+ },
createColumnConstraint: function(spec, options) {
var constraint = [];
Please sign in to comment.
Something went wrong with that request. Please try again.