diff --git a/index.js b/index.js index f1d7e42..40f4553 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,3 @@ -var Sequelize = require('sequelize'); - function JsonField(db, modelName, fieldName, options) { var self = this; options = options || {}; @@ -20,7 +18,7 @@ function JsonField(db, modelName, fieldName, options) { }); var model = { - type: options.type || Sequelize.TEXT, + type: options.type || db.constructor.TEXT, get: function() { var currentValue = this.getDataValue(fieldName); if (typeof currentValue == 'string') { diff --git a/package.json b/package.json index e0fa4de..7675953 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "mocha": "^2.1.0", "sqlite3": "^3.0.5" }, - "dependencies": { - "sequelize": "^3.6.0" + "peerDependencies": { + "sequelize": "^ 3 || ^4" } }