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.
66 lines
1.2 KiB
66 lines
1.2 KiB
4 years ago
|
import _sequelize from 'sequelize';
|
||
|
const { Model, Sequelize } = _sequelize;
|
||
|
|
||
|
export default class user extends Model {
|
||
|
static init(sequelize, DataTypes) {
|
||
|
super.init({
|
||
|
ID: {
|
||
|
autoIncrement: true,
|
||
|
type: DataTypes.BIGINT,
|
||
|
allowNull: false,
|
||
|
primaryKey: true
|
||
|
},
|
||
|
UserID: {
|
||
|
type: DataTypes.INTEGER,
|
||
|
allowNull: true
|
||
|
},
|
||
|
IPAddress: {
|
||
|
type: DataTypes.STRING(100),
|
||
|
allowNull: false
|
||
|
},
|
||
|
EventDate: {
|
||
|
type: DataTypes.DATE,
|
||
|
allowNull: false,
|
||
|
defaultValue: Sequelize.fn('current_timestamp')
|
||
|
},
|
||
|
MessageID: {
|
||
|
type: DataTypes.SMALLINT,
|
||
|
allowNull: false
|
||
|
},
|
||
|
Data: {
|
||
|
type: DataTypes.TEXT,
|
||
|
allowNull: true
|
||
|
},
|
||
|
Severity: {
|
||
|
type: DataTypes.TINYINT.UNSIGNED,
|
||
|
allowNull: false
|
||
|
},
|
||
|
Succeeded: {
|
||
|
type: DataTypes.TINYINT,
|
||
|
allowNull: false,
|
||
|
defaultValue: 1
|
||
|
},
|
||
|
Duration: {
|
||
|
type: DataTypes.BIGINT,
|
||
|
allowNull: false
|
||
|
}
|
||
|
}, {
|
||
|
sequelize,
|
||
|
tableName: 'user',
|
||
|
hasTrigger: true,
|
||
|
timestamps: false,
|
||
|
indexes: [
|
||
|
{
|
||
|
name: "PRIMARY",
|
||
|
unique: true,
|
||
|
using: "BTREE",
|
||
|
fields: [
|
||
|
{ name: "ID" },
|
||
|
]
|
||
|
},
|
||
|
]
|
||
|
});
|
||
|
return user;
|
||
|
}
|
||
|
}
|