From 5934130888e09934b0c4501f3ae0b43c5081c990 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Dec 2025 15:55:58 +0530 Subject: [PATCH] datatype chaged for description and product name --- app/models/UnitMaster.model.js | 4 ++-- app/models/product.model.js | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/models/UnitMaster.model.js b/app/models/UnitMaster.model.js index 7a0825b..c09e1c8 100644 --- a/app/models/UnitMaster.model.js +++ b/app/models/UnitMaster.model.js @@ -29,11 +29,11 @@ module.exports = (sequelize, DataTypes) => { allowNull: true, }, description: { - type: DataTypes.STRING, + type: DataTypes.STRING(1000), allowNull: true, validate: { len: { - args: [0, 1000], + args: [1, 1000], msg: "Description is too long. Maximum allowed length is 1000 characters." }} }, diff --git a/app/models/product.model.js b/app/models/product.model.js index 9a0d619..0ad0664 100644 --- a/app/models/product.model.js +++ b/app/models/product.model.js @@ -6,12 +6,12 @@ module.exports = (sequelize, DataTypes) => { primaryKey: true, }, product_name: { - type: DataTypes.TEXT, - allowNull: false, - unique: true, - validate: { + type: DataTypes.STRING(1000), + allowNull: false, + unique: true, + validate: { len: { - args: [0, 1000], + args: [1, 1000], msg: "Product Name is too long. Maximum allowed length is 1000 characters." }} }, @@ -26,11 +26,11 @@ module.exports = (sequelize, DataTypes) => { }} }, hs_description: { - type: DataTypes.TEXT, + type: DataTypes.STRING(1000), allowNull: true, validate: { len: { - args: [0, 1000], + args: [1, 1000], msg: "HS Description is too long. Maximum allowed length is 1000 characters." }} },