65 lines
1.3 KiB
JavaScript
65 lines
1.3 KiB
JavaScript
const db = require("../../middleware/db");
|
|
const Sequelize = require("sequelize");
|
|
|
|
|
|
module.exports = sof_sofawa_ga = db.define("sof_sofawa_ga", {
|
|
|
|
sofaKey: {
|
|
type: Sequelize.STRING(100),
|
|
allowNull: false,
|
|
defaultValue: "",
|
|
comment: "软件key",
|
|
},
|
|
version: {
|
|
type: Sequelize.STRING(100),
|
|
allowNull: false,
|
|
defaultValue: "",
|
|
comment: "版本号",
|
|
},
|
|
serialNumber: {
|
|
type: Sequelize.STRING(200),
|
|
allowNull: false,
|
|
defaultValue: "",
|
|
comment: "硬盘序列号",
|
|
},
|
|
|
|
ip: {
|
|
type: Sequelize.STRING(100),
|
|
allowNull: false,
|
|
defaultValue: "",
|
|
comment: "ip",
|
|
},
|
|
position: {
|
|
type: Sequelize.STRING(200),
|
|
allowNull: false,
|
|
defaultValue: "",
|
|
comment: "功能位置",
|
|
},
|
|
type: {
|
|
type: Sequelize.STRING(100),
|
|
allowNull: false,
|
|
defaultValue: "",
|
|
comment: "类型",
|
|
},
|
|
msg: {
|
|
type: Sequelize.JSON,
|
|
allowNull: false,
|
|
defaultValue: "{}",
|
|
comment: "详细信息",
|
|
set(value) {
|
|
this.setDataValue('msg', { value });
|
|
},
|
|
get() {
|
|
let jsonValue = this.getDataValue("msg")
|
|
if (jsonValue && jsonValue.value !== undefined) {
|
|
return jsonValue.value;
|
|
}
|
|
else {
|
|
return jsonValue
|
|
}
|
|
}
|
|
},
|
|
});
|
|
|
|
//sof_sofawa_ga.sync({ force: true });
|