Fix field type to prevent data truncation of authorship (#721)
* Fix field type to prevent data truncation of authorship
This commit is contained in:
parent
dfa0851d8f
commit
bb5e021f20
3 changed files with 15 additions and 2 deletions
13
lib/migrations/20180209120907-longtext-of-authorship.js
Normal file
13
lib/migrations/20180209120907-longtext-of-authorship.js
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
up: function (queryInterface, Sequelize) {
|
||||||
|
queryInterface.changeColumn('Notes', 'authorship', {type: Sequelize.TEXT('long')})
|
||||||
|
queryInterface.changeColumn('Revisions', 'authorship', {type: Sequelize.TEXT('long')})
|
||||||
|
},
|
||||||
|
|
||||||
|
down: function (queryInterface, Sequelize) {
|
||||||
|
queryInterface.changeColumn('Notes', 'authorship', {type: Sequelize.TEXT})
|
||||||
|
queryInterface.changeColumn('Revisions', 'authorship', {type: Sequelize.TEXT})
|
||||||
|
}
|
||||||
|
}
|
|
@ -69,7 +69,7 @@ module.exports = function (sequelize, DataTypes) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
authorship: {
|
authorship: {
|
||||||
type: DataTypes.TEXT,
|
type: DataTypes.TEXT('long'),
|
||||||
get: function () {
|
get: function () {
|
||||||
return sequelize.processData(this.getDataValue('authorship'), [], JSON.parse)
|
return sequelize.processData(this.getDataValue('authorship'), [], JSON.parse)
|
||||||
},
|
},
|
||||||
|
|
|
@ -88,7 +88,7 @@ module.exports = function (sequelize, DataTypes) {
|
||||||
type: DataTypes.INTEGER
|
type: DataTypes.INTEGER
|
||||||
},
|
},
|
||||||
authorship: {
|
authorship: {
|
||||||
type: DataTypes.TEXT,
|
type: DataTypes.TEXT('long'),
|
||||||
get: function () {
|
get: function () {
|
||||||
return sequelize.processData(this.getDataValue('authorship'), [], JSON.parse)
|
return sequelize.processData(this.getDataValue('authorship'), [], JSON.parse)
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue