smc_cet_otherincome_backend/app/models/OtherIncomeP.js
2022-06-28 12:19:01 +05:30

32 lines
787 B
JavaScript

'use strict'
const { Model } = require('sequelize')
module.exports = (sequelize, DataTypes) => {
class OtherIncomeP extends Model {
}
OtherIncomeP.init(
{
losid: { type: DataTypes.STRING },
order_id: { type: DataTypes.INTEGER },
table_name: { type: DataTypes.STRING },
particulars: { type: DataTypes.STRING },
is_active: { type: DataTypes.INTEGER },
createdby: { type: DataTypes.INTEGER },
updatedby: { type: DataTypes.INTEGER }
},
{
sequelize,
tableName: 'other_income_p',
modelName: 'OtherIncomeP',
}
)
OtherIncomeP.associate = models => {
OtherIncomeP.hasMany(models.OtherIncomeC, {
foreignKey: 'other_income_id',
sourceKey : 'id'
});
}
return OtherIncomeP
}