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.
53 lines
1019 B
53 lines
1019 B
4 years ago
|
import _sequelize from 'sequelize';
|
||
|
const { Model, Sequelize } = _sequelize;
|
||
|
|
||
|
export default class system 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')
|
||
|
},
|
||
|
MessageID: {
|
||
|
type: DataTypes.SMALLINT,
|
||
|
allowNull: false
|
||
|
},
|
||
|
Data: {
|
||
|
type: DataTypes.TEXT,
|
||
|
allowNull: true
|
||
|
},
|
||
|
Severity: {
|
||
|
type: DataTypes.TINYINT.UNSIGNED,
|
||
|
allowNull: false
|
||
|
},
|
||
|
Duration: {
|
||
|
type: DataTypes.BIGINT,
|
||
|
allowNull: false
|
||
|
}
|
||
|
}, {
|
||
|
sequelize,
|
||
|
tableName: 'system',
|
||
|
hasTrigger: true,
|
||
|
timestamps: false,
|
||
|
indexes: [
|
||
|
{
|
||
|
name: "PRIMARY",
|
||
|
unique: true,
|
||
|
using: "BTREE",
|
||
|
fields: [
|
||
|
{ name: "ID" },
|
||
|
]
|
||
|
},
|
||
|
]
|
||
|
});
|
||
|
return system;
|
||
|
}
|
||
|
}
|