diff --git a/migrations/20200130_increase_metadata_info_length.sql b/migrations/20200130_increase_metadata_info_length.sql new file mode 100644 index 00000000..677124d2 --- /dev/null +++ b/migrations/20200130_increase_metadata_info_length.sql @@ -0,0 +1,23 @@ +-- +-- UPDATE EXISTING TABLES: +-- project_templates: +-- modify column `info` +-- project_types: +-- modify column `info` +-- product_categories: +-- modify column `info` + +-- +-- project_templates + +ALTER TABLE project_templates ALTER COLUMN "info" TYPE character varying(1024); + +-- +-- project_types + +ALTER TABLE project_types ALTER COLUMN "info" TYPE character varying(1024); + +-- +-- product_categories + +ALTER TABLE product_categories ALTER COLUMN "info" TYPE character varying(1024); \ No newline at end of file diff --git a/src/models/productCategory.js b/src/models/productCategory.js index 07f745ef..80a08ab3 100644 --- a/src/models/productCategory.js +++ b/src/models/productCategory.js @@ -9,7 +9,7 @@ module.exports = function defineProductCategory(sequelize, DataTypes) { displayName: { type: DataTypes.STRING(255), allowNull: false }, icon: { type: DataTypes.STRING(255), allowNull: false }, question: { type: DataTypes.STRING(255), allowNull: false }, - info: { type: DataTypes.STRING(255), allowNull: false }, + info: { type: DataTypes.STRING(1024), allowNull: false }, aliases: { type: DataTypes.JSON, allowNull: false }, disabled: { type: DataTypes.BOOLEAN, defaultValue: false }, hidden: { type: DataTypes.BOOLEAN, defaultValue: false }, diff --git a/src/models/projectTemplate.js b/src/models/projectTemplate.js index 3b61600b..75c8fe48 100644 --- a/src/models/projectTemplate.js +++ b/src/models/projectTemplate.js @@ -16,7 +16,7 @@ module.exports = (sequelize, DataTypes) => { metadata: { type: DataTypes.JSON, allowNull: false, defaultValue: {} }, icon: { type: DataTypes.STRING(255), allowNull: false }, question: { type: DataTypes.STRING(255), allowNull: false }, - info: { type: DataTypes.STRING(255), allowNull: false }, + info: { type: DataTypes.STRING(1024), allowNull: false }, aliases: { type: DataTypes.JSON, allowNull: false }, scope: { type: DataTypes.JSON, allowNull: true }, phases: { type: DataTypes.JSON, allowNull: true }, diff --git a/src/models/projectType.js b/src/models/projectType.js index 19618698..f233f3b5 100644 --- a/src/models/projectType.js +++ b/src/models/projectType.js @@ -6,7 +6,7 @@ module.exports = function definePhaseProduct(sequelize, DataTypes) { displayName: { type: DataTypes.STRING(255), allowNull: false }, icon: { type: DataTypes.STRING(255), allowNull: false }, question: { type: DataTypes.STRING(255), allowNull: false }, - info: { type: DataTypes.STRING(255), allowNull: false }, + info: { type: DataTypes.STRING(1024), allowNull: false }, aliases: { type: DataTypes.JSON, allowNull: false }, disabled: { type: DataTypes.BOOLEAN, defaultValue: false }, hidden: { type: DataTypes.BOOLEAN, defaultValue: false }, diff --git a/src/routes/productCategories/create.js b/src/routes/productCategories/create.js index 4abce161..ff97a3d5 100644 --- a/src/routes/productCategories/create.js +++ b/src/routes/productCategories/create.js @@ -17,7 +17,7 @@ const schema = { displayName: Joi.string().max(255).required(), icon: Joi.string().max(255).required(), question: Joi.string().max(255).required(), - info: Joi.string().max(255).required(), + info: Joi.string().max(1024).required(), aliases: Joi.array().required(), disabled: Joi.boolean().optional(), hidden: Joi.boolean().optional(), diff --git a/src/routes/productCategories/update.js b/src/routes/productCategories/update.js index f4b7611e..1119e27e 100644 --- a/src/routes/productCategories/update.js +++ b/src/routes/productCategories/update.js @@ -21,7 +21,7 @@ const schema = { displayName: Joi.string().max(255).optional(), icon: Joi.string().max(255).optional(), question: Joi.string().max(255).optional(), - info: Joi.string().max(255).optional(), + info: Joi.string().max(1024).optional(), aliases: Joi.array().optional(), disabled: Joi.boolean().optional(), hidden: Joi.boolean().optional(), diff --git a/src/routes/projectTemplates/create.js b/src/routes/projectTemplates/create.js index 9e68fc47..473139f7 100644 --- a/src/routes/projectTemplates/create.js +++ b/src/routes/projectTemplates/create.js @@ -22,7 +22,7 @@ const schema = { metadata: Joi.object(), icon: Joi.string().max(255).required(), question: Joi.string().max(255).required(), - info: Joi.string().max(255).required(), + info: Joi.string().max(1024).required(), aliases: Joi.array().required(), scope: Joi.object().empty(null), phases: Joi.object().empty(null), diff --git a/src/routes/projectTemplates/update.js b/src/routes/projectTemplates/update.js index b2755771..6661a520 100644 --- a/src/routes/projectTemplates/update.js +++ b/src/routes/projectTemplates/update.js @@ -25,7 +25,7 @@ const schema = { metadata: Joi.object(), icon: Joi.string().max(255), question: Joi.string().max(255), - info: Joi.string().max(255), + info: Joi.string().max(1024), aliases: Joi.array(), scope: Joi.object().empty(null), phases: Joi.object().empty(null), diff --git a/src/routes/projectTypes/create.js b/src/routes/projectTypes/create.js index 88051a51..462da1b7 100644 --- a/src/routes/projectTypes/create.js +++ b/src/routes/projectTypes/create.js @@ -17,7 +17,7 @@ const schema = { displayName: Joi.string().max(255).required(), icon: Joi.string().max(255).required(), question: Joi.string().max(255).required(), - info: Joi.string().max(255).required(), + info: Joi.string().max(1024).required(), aliases: Joi.array().required(), disabled: Joi.boolean().optional(), hidden: Joi.boolean().optional(), diff --git a/src/routes/projectTypes/update.js b/src/routes/projectTypes/update.js index 9cb09002..174ee01a 100644 --- a/src/routes/projectTypes/update.js +++ b/src/routes/projectTypes/update.js @@ -20,7 +20,7 @@ const schema = { displayName: Joi.string().max(255).optional(), icon: Joi.string().max(255).optional(), question: Joi.string().max(255).optional(), - info: Joi.string().max(255).optional(), + info: Joi.string().max(1024).optional(), aliases: Joi.array().optional(), disabled: Joi.boolean().optional(), hidden: Joi.boolean().optional(),