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.
128 lines
2.8 KiB
128 lines
2.8 KiB
3 years ago
|
/* eslint-disable*/
|
||
|
'use strict';
|
||
|
|
||
|
module.exports = dc => {
|
||
|
const DataTypes = dc.ORM;
|
||
|
const sequelize = dc.orm;
|
||
3 years ago
|
const Nvr = sequelize.define("nvr", {
|
||
3 years ago
|
id: {
|
||
|
type: DataTypes.INTEGER,
|
||
|
allowNull: false,
|
||
|
defaultValue: null,
|
||
|
comment: null,
|
||
|
primaryKey: true,
|
||
|
field: "id",
|
||
|
autoIncrement: true,
|
||
3 years ago
|
unique: "nvr_id_uindex"
|
||
3 years ago
|
},
|
||
|
name: {
|
||
|
type: DataTypes.STRING,
|
||
|
allowNull: false,
|
||
|
defaultValue: null,
|
||
|
comment: null,
|
||
|
primaryKey: false,
|
||
|
field: "name",
|
||
|
autoIncrement: false
|
||
|
},
|
||
3 years ago
|
venderId: {
|
||
|
type: DataTypes.INTEGER,
|
||
|
allowNull: true,
|
||
|
defaultValue: null,
|
||
|
comment: "设备厂家id",
|
||
|
primaryKey: false,
|
||
|
field: "vender_id",
|
||
|
autoIncrement: false,
|
||
|
references: {
|
||
|
key: "id",
|
||
|
model: "vender"
|
||
|
}
|
||
|
},
|
||
|
serialNo: {
|
||
3 years ago
|
type: DataTypes.STRING,
|
||
|
allowNull: false,
|
||
|
defaultValue: null,
|
||
3 years ago
|
comment: "设备编号",
|
||
3 years ago
|
primaryKey: false,
|
||
3 years ago
|
field: "serial_no",
|
||
3 years ago
|
autoIncrement: false
|
||
|
},
|
||
3 years ago
|
regionCode: {
|
||
3 years ago
|
type: DataTypes.STRING,
|
||
3 years ago
|
allowNull: true,
|
||
|
defaultValue: null,
|
||
|
comment: "行政区码",
|
||
|
primaryKey: false,
|
||
|
field: "region_code",
|
||
|
autoIncrement: false
|
||
|
},
|
||
|
longitude: {
|
||
|
type: DataTypes.DOUBLE,
|
||
3 years ago
|
allowNull: false,
|
||
|
defaultValue: null,
|
||
|
comment: null,
|
||
|
primaryKey: false,
|
||
3 years ago
|
field: "longitude",
|
||
3 years ago
|
autoIncrement: false
|
||
|
},
|
||
3 years ago
|
latitude: {
|
||
|
type: DataTypes.DOUBLE,
|
||
3 years ago
|
allowNull: false,
|
||
|
defaultValue: null,
|
||
3 years ago
|
comment: null,
|
||
3 years ago
|
primaryKey: false,
|
||
3 years ago
|
field: "latitude",
|
||
3 years ago
|
autoIncrement: false
|
||
|
},
|
||
3 years ago
|
createTime: {
|
||
|
type: DataTypes.DATE,
|
||
|
allowNull: false,
|
||
|
defaultValue: sequelize.fn('now'),
|
||
|
comment: "创建时间",
|
||
|
primaryKey: false,
|
||
|
field: "create_time",
|
||
|
autoIncrement: false
|
||
|
},
|
||
|
channelCount: {
|
||
|
type: DataTypes.INTEGER,
|
||
3 years ago
|
allowNull: true,
|
||
|
defaultValue: null,
|
||
3 years ago
|
comment: "通道数",
|
||
3 years ago
|
primaryKey: false,
|
||
3 years ago
|
field: "channel_count",
|
||
3 years ago
|
autoIncrement: false
|
||
|
},
|
||
3 years ago
|
port: {
|
||
|
type: DataTypes.STRING,
|
||
|
allowNull: true,
|
||
3 years ago
|
defaultValue: null,
|
||
3 years ago
|
comment: "端口",
|
||
3 years ago
|
primaryKey: false,
|
||
3 years ago
|
field: "port",
|
||
3 years ago
|
autoIncrement: false
|
||
|
},
|
||
|
delete: {
|
||
|
type: DataTypes.BOOLEAN,
|
||
|
allowNull: false,
|
||
|
defaultValue: null,
|
||
|
comment: null,
|
||
|
primaryKey: false,
|
||
|
field: "delete",
|
||
|
autoIncrement: false
|
||
|
},
|
||
3 years ago
|
createUserId: {
|
||
|
type: DataTypes.INTEGER,
|
||
3 years ago
|
allowNull: false,
|
||
|
defaultValue: null,
|
||
3 years ago
|
comment: null,
|
||
3 years ago
|
primaryKey: false,
|
||
3 years ago
|
field: "create_user_id",
|
||
3 years ago
|
autoIncrement: false
|
||
|
}
|
||
|
}, {
|
||
3 years ago
|
tableName: "nvr",
|
||
3 years ago
|
comment: "",
|
||
|
indexes: []
|
||
|
});
|
||
3 years ago
|
dc.models.Nvr = Nvr;
|
||
|
return Nvr;
|
||
3 years ago
|
};
|