fcsc_ipi_backend/app/models/isic2DigitIndices.model.js
2025-12-24 16:46:10 +05:30

59 lines
1.3 KiB
JavaScript

module.exports = (sequelize, DataTypes) => {
const Isic2DigitIndices = sequelize.define("isic_2digit_indices", {
id: {
type: DataTypes.INTEGER,
autoIncrement: true,
primaryKey: true,
},
isic_2digit_code: {
type: DataTypes.STRING,
allowNull: false,
},
isic_description: {
type: DataTypes.STRING,
allowNull: true,
validate: {
len: {
args: [0, 1000],
msg: "Description is too long. Maximum allowed length is 1000 characters."
}}
},
year: {
type: DataTypes.INTEGER,
allowNull: false,
},
month: {
type: DataTypes.INTEGER,
allowNull: false,
},
month_name: {
type: DataTypes.STRING,
allowNull: false,
},
total_weight: {
type: DataTypes.DECIMAL(10, 2),
allowNull: false,
},
weighted_index_sum: {
type: DataTypes.DECIMAL(10, 4),
allowNull: false,
},
isic_2digit_index: {
type: DataTypes.DECIMAL(10, 2),
allowNull: false,
},
created_at: {
type: DataTypes.DATE,
defaultValue: DataTypes.NOW,
},
updated_at: {
type: DataTypes.DATE,
allowNull: true,
},
}, {
tableName: "isic_2digit_indices",
timestamps: false,
});
return Isic2DigitIndices;
};