datatype chaged for description and product name

This commit is contained in:
unknown 2025-12-11 15:55:58 +05:30
parent 87f9b87a0d
commit 5934130888
2 changed files with 9 additions and 9 deletions

View File

@ -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."
}}
},

View File

@ -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."
}}
},