40 lines
1.1 KiB
JavaScript
40 lines
1.1 KiB
JavaScript
'use strict'
|
|
const { Model } = require('sequelize')
|
|
module.exports = (sequelize, DataTypes) => {
|
|
class Fin_masters_history 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' })
|
|
//}
|
|
|
|
|
|
}
|
|
Fin_masters_history.init(
|
|
{
|
|
|
|
table_name: { type: DataTypes.STRING },
|
|
column_name: { type: DataTypes.STRING },
|
|
data_id: { type: DataTypes.INTEGER },
|
|
old_data: { type: DataTypes.STRING },
|
|
new_data: { type: DataTypes.STRING },
|
|
user_id: { type: DataTypes.INTEGER },
|
|
user_name: { type: DataTypes.STRING },
|
|
|
|
},
|
|
{
|
|
sequelize,
|
|
tableName: 'fin_masters_history',
|
|
modelName: 'Fin_masters_history',
|
|
createdAt: 'created_at',
|
|
updatedAt: false,
|
|
|
|
}
|
|
)
|
|
return Fin_masters_history
|
|
}
|