You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.3 KiB
68 lines
1.3 KiB
import _sequelize from 'sequelize'; |
|
const { Model, Sequelize } = _sequelize; |
|
|
|
export default class history extends Model { |
|
static init(sequelize, DataTypes) { |
|
super.init({ |
|
ID: { |
|
autoIncrement: true, |
|
type: DataTypes.BIGINT, |
|
allowNull: false, |
|
primaryKey: true |
|
}, |
|
EventDate: { |
|
type: DataTypes.DATE, |
|
allowNull: false, |
|
defaultValue: Sequelize.fn('current_timestamp') |
|
}, |
|
ChangeType: { |
|
type: DataTypes.TINYINT.UNSIGNED, |
|
allowNull: false |
|
}, |
|
UserID: { |
|
type: DataTypes.INTEGER, |
|
allowNull: false |
|
}, |
|
FullName: { |
|
type: DataTypes.STRING(100), |
|
allowNull: true |
|
}, |
|
IPAddress: { |
|
type: DataTypes.STRING(100), |
|
allowNull: false |
|
}, |
|
TableName: { |
|
type: DataTypes.STRING(50), |
|
allowNull: false |
|
}, |
|
RowID: { |
|
type: DataTypes.BIGINT, |
|
allowNull: false |
|
}, |
|
Data: { |
|
type: DataTypes.TEXT, |
|
allowNull: false |
|
}, |
|
Hash: { |
|
type: DataTypes.STRING(64), |
|
allowNull: false |
|
} |
|
}, { |
|
sequelize, |
|
tableName: 'history', |
|
hasTrigger: true, |
|
timestamps: false, |
|
indexes: [ |
|
{ |
|
name: "PRIMARY", |
|
unique: true, |
|
using: "BTREE", |
|
fields: [ |
|
{ name: "ID" }, |
|
] |
|
}, |
|
] |
|
}); |
|
return history; |
|
} |
|
}
|
|
|