Comparing version 1.2.4 to 1.3.0
@@ -36,2 +36,4 @@ 'use strict'; | ||
* holding migration name | ||
* @param {String} [options.storageOptions.columnType=Sequelize.STRING] type of the column | ||
* For utf8mb4 charsets under InnoDB, you may need to set this <= 190 | ||
*/ | ||
@@ -45,3 +47,5 @@ module.exports = redefine.Class({ | ||
// note 'tableName' (optional) also supported | ||
columnName: 'name' | ||
columnName: 'name', | ||
// You may need to override this for utf8mb4 charsets | ||
columnType: Sequelize.STRING | ||
}, this.options.storageOptions || {}); | ||
@@ -64,3 +68,3 @@ | ||
attributes[this.options.storageOptions.columnName] = { | ||
type: Sequelize.STRING, | ||
type: this.options.storageOptions.columnType, | ||
allowNull: false, | ||
@@ -67,0 +71,0 @@ unique: true, |
{ | ||
"name": "umzug", | ||
"version": "1.2.4", | ||
"version": "1.3.0", | ||
"description": "Framework agnostic migration tool for Node.JS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -113,2 +113,23 @@ 'use strict'; | ||
it('accepts a "columnType" option', function () { | ||
var storage = new Storage({ | ||
storageOptions: { | ||
sequelize: this.sequelize, | ||
columnType: new Sequelize.STRING(190) | ||
} | ||
}); | ||
return storage.options.storageOptions.model.sync() | ||
.then(function (model) { | ||
return model.describe(); | ||
}) | ||
.then(function(description) { | ||
expect(description.name).to.eql({ | ||
type: 'VARCHAR(190)', | ||
allowNull: false, | ||
defaultValue: null, | ||
primaryKey: true | ||
}); | ||
}); | ||
}); | ||
it('accepts a "model" option', function () { | ||
@@ -115,0 +136,0 @@ var Model = this.sequelize.define('CustomModel', { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
78499
21
1884