44 lines
1.2 KiB
JavaScript
44 lines
1.2 KiB
JavaScript
'use strict'
|
|
const { Model } = require('sequelize')
|
|
module.exports = (sequelize, DataTypes) => {
|
|
class Financials 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({ Model_name }) {
|
|
//this.hasMany(Model_name, { foreignKey: 'child_table_prim_key', as: 'child_tbl_name' })
|
|
//}
|
|
|
|
|
|
}
|
|
Financials.init(
|
|
|
|
{
|
|
entity_id: { type: DataTypes.INTEGER },
|
|
fy: { type: DataTypes.STRING },
|
|
st_type:{ type: DataTypes.STRING },
|
|
itemid: { type: DataTypes.INTEGER },
|
|
is_editable: { type: DataTypes.INTEGER },
|
|
is_active: { type: DataTypes.INTEGER },
|
|
value: { type: DataTypes.INTEGER },
|
|
sub_value: { type: DataTypes.STRING },
|
|
createdby: { type: DataTypes.INTEGER },
|
|
updatedby: { type: DataTypes.INTEGER },
|
|
|
|
},
|
|
|
|
{
|
|
sequelize,
|
|
tableName: 'financials',
|
|
modelName: 'Financials',
|
|
createdAt: 'createdon',
|
|
updatedAt: 'updatedon',
|
|
}
|
|
)
|
|
|
|
return Financials
|
|
}
|