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.
88 lines
1.9 KiB
88 lines
1.9 KiB
1 year ago
|
/* eslint-disable*/
|
||
|
'use strict';
|
||
|
|
||
|
module.exports = dc => {
|
||
|
const DataTypes = dc.ORM;
|
||
|
const sequelize = dc.orm;
|
||
|
const Device = sequelize.define("device", {
|
||
|
id: {
|
||
|
type: DataTypes.INTEGER,
|
||
|
allowNull: false,
|
||
|
defaultValue: null,
|
||
|
comment: null,
|
||
|
primaryKey: true,
|
||
|
field: "id",
|
||
|
autoIncrement: true,
|
||
|
unique: "device_id_uindex"
|
||
|
},
|
||
|
name: {
|
||
|
type: DataTypes.STRING,
|
||
|
allowNull: false,
|
||
|
defaultValue: null,
|
||
|
comment: null,
|
||
|
primaryKey: false,
|
||
|
field: "name",
|
||
|
autoIncrement: false
|
||
|
},
|
||
|
type: {
|
||
|
type: DataTypes.STRING,
|
||
|
allowNull: false,
|
||
|
defaultValue: null,
|
||
|
comment: null,
|
||
|
primaryKey: false,
|
||
|
field: "type",
|
||
|
autoIncrement: false
|
||
|
},
|
||
|
specification: {
|
||
|
type: DataTypes.STRING,
|
||
|
allowNull: true,
|
||
|
defaultValue: null,
|
||
|
comment: "规格\r\n",
|
||
|
primaryKey: false,
|
||
|
field: "specification",
|
||
|
autoIncrement: false
|
||
|
},
|
||
|
dateProduced: {
|
||
|
type: DataTypes.DATEONLY,
|
||
|
allowNull: true,
|
||
|
defaultValue: null,
|
||
|
comment: "生产日期",
|
||
|
primaryKey: false,
|
||
|
field: "date_produced",
|
||
|
autoIncrement: false
|
||
|
},
|
||
|
dateInstall: {
|
||
|
type: DataTypes.DATEONLY,
|
||
|
allowNull: true,
|
||
|
defaultValue: null,
|
||
|
comment: "安装日期",
|
||
|
primaryKey: false,
|
||
|
field: "date_install",
|
||
|
autoIncrement: false
|
||
|
},
|
||
|
dateGuarantee: {
|
||
|
type: DataTypes.DATEONLY,
|
||
|
allowNull: true,
|
||
|
defaultValue: null,
|
||
|
comment: "质保期",
|
||
|
primaryKey: false,
|
||
|
field: "date_guarantee",
|
||
|
autoIncrement: false
|
||
|
},
|
||
|
dateMainten: {
|
||
|
type: DataTypes.DATEONLY,
|
||
|
allowNull: true,
|
||
|
defaultValue: null,
|
||
|
comment: "维保期",
|
||
|
primaryKey: false,
|
||
|
field: "date_mainten",
|
||
|
autoIncrement: false
|
||
|
}
|
||
|
}, {
|
||
|
tableName: "device",
|
||
|
comment: "",
|
||
|
indexes: []
|
||
|
});
|
||
|
dc.models.Device = Device;
|
||
|
return Device;
|
||
|
};
|