smc_cet_financials_backend/app/models/Subsectionsmaster.js

40 lines
1.2 KiB
JavaScript

'use strict'
const { Model } = require('sequelize')
module.exports = (sequelize, DataTypes) => {
class Subsectionsmaster extends Model {
/**
* Helper method for defining associations.
* This method is not a part of Sequelize lifecycle.
* The `models/index` file will call this method automatically.
*/
// define association here
static associate({ Sectionsmaster }) {
this.belongsTo(Sectionsmaster, { foreignKey: 'id', as: 'sectionsmasterData' })
}
// static associate({ Model_name }) {
// this.hasMany(Model_name, { foreignKey: 'child_table_prim_key', as: 'child_tbl_name' })
// }
}
Subsectionsmaster.init(
{
section: { type: DataTypes.INTEGER },
subsection: { type: DataTypes.STRING },
itemtext: { type: DataTypes.STRING },
is_active: { type: DataTypes.INTEGER },
createdby: { type: DataTypes.INTEGER },
updatedby: { type: DataTypes.INTEGER },
},
{
sequelize,
tableName: 'subsectionsmaster',
modelName: 'Subsectionsmaster',
createdAt: 'createdon',
updatedAt: 'updatedon',
}
)
return Subsectionsmaster
}