|
|
@ -2,104 +2,104 @@ |
|
|
|
'use strict'; |
|
|
|
|
|
|
|
module.exports = dc => { |
|
|
|
const DataTypes = dc.ORM; |
|
|
|
const sequelize = dc.orm; |
|
|
|
const Project = sequelize.define("project", { |
|
|
|
id: { |
|
|
|
type: DataTypes.INTEGER, |
|
|
|
allowNull: false, |
|
|
|
defaultValue: null, |
|
|
|
comment: null, |
|
|
|
primaryKey: true, |
|
|
|
field: "id", |
|
|
|
autoIncrement: true |
|
|
|
}, |
|
|
|
name: { |
|
|
|
type: DataTypes.STRING, |
|
|
|
allowNull: true, |
|
|
|
defaultValue: null, |
|
|
|
comment: null, |
|
|
|
primaryKey: false, |
|
|
|
field: "name", |
|
|
|
autoIncrement: false |
|
|
|
}, |
|
|
|
type: { |
|
|
|
type: DataTypes.STRING, |
|
|
|
allowNull: true, |
|
|
|
defaultValue: null, |
|
|
|
comment: null, |
|
|
|
primaryKey: false, |
|
|
|
field: "type", |
|
|
|
autoIncrement: false |
|
|
|
}, |
|
|
|
longitude: { |
|
|
|
type: DataTypes.STRING, |
|
|
|
allowNull: true, |
|
|
|
defaultValue: null, |
|
|
|
comment: null, |
|
|
|
primaryKey: false, |
|
|
|
field: "longitude", |
|
|
|
autoIncrement: false |
|
|
|
}, |
|
|
|
latitude: { |
|
|
|
type: DataTypes.STRING, |
|
|
|
allowNull: true, |
|
|
|
defaultValue: null, |
|
|
|
comment: null, |
|
|
|
primaryKey: false, |
|
|
|
field: "latitude", |
|
|
|
autoIncrement: false |
|
|
|
}, |
|
|
|
describe: { |
|
|
|
type: DataTypes.STRING, |
|
|
|
allowNull: true, |
|
|
|
defaultValue: null, |
|
|
|
comment: null, |
|
|
|
primaryKey: false, |
|
|
|
field: "describe", |
|
|
|
autoIncrement: false |
|
|
|
}, |
|
|
|
userId: { |
|
|
|
type: DataTypes.INTEGER, |
|
|
|
allowNull: true, |
|
|
|
defaultValue: null, |
|
|
|
comment: null, |
|
|
|
primaryKey: false, |
|
|
|
field: "user_id", |
|
|
|
autoIncrement: false |
|
|
|
}, |
|
|
|
img: { |
|
|
|
type: array, |
|
|
|
allowNull: true, |
|
|
|
defaultValue: null, |
|
|
|
comment: null, |
|
|
|
primaryKey: false, |
|
|
|
field: "img", |
|
|
|
autoIncrement: false |
|
|
|
}, |
|
|
|
qrCode: { |
|
|
|
type: DataTypes.STRING, |
|
|
|
allowNull: true, |
|
|
|
defaultValue: null, |
|
|
|
comment: null, |
|
|
|
primaryKey: false, |
|
|
|
field: "qr_code", |
|
|
|
autoIncrement: false |
|
|
|
}, |
|
|
|
subType: { |
|
|
|
type: DataTypes.STRING, |
|
|
|
allowNull: true, |
|
|
|
defaultValue: null, |
|
|
|
comment: "子类型-子系统", |
|
|
|
primaryKey: false, |
|
|
|
field: "sub_type", |
|
|
|
autoIncrement: false |
|
|
|
} |
|
|
|
}, { |
|
|
|
tableName: "project", |
|
|
|
comment: "", |
|
|
|
indexes: [] |
|
|
|
}); |
|
|
|
dc.models.Project = Project; |
|
|
|
return Project; |
|
|
|
const DataTypes = dc.ORM; |
|
|
|
const sequelize = dc.orm; |
|
|
|
const Project = sequelize.define("project", { |
|
|
|
id: { |
|
|
|
type: DataTypes.INTEGER, |
|
|
|
allowNull: false, |
|
|
|
defaultValue: null, |
|
|
|
comment: null, |
|
|
|
primaryKey: true, |
|
|
|
field: "id", |
|
|
|
autoIncrement: true |
|
|
|
}, |
|
|
|
name: { |
|
|
|
type: DataTypes.STRING, |
|
|
|
allowNull: true, |
|
|
|
defaultValue: null, |
|
|
|
comment: null, |
|
|
|
primaryKey: false, |
|
|
|
field: "name", |
|
|
|
autoIncrement: false |
|
|
|
}, |
|
|
|
type: { |
|
|
|
type: DataTypes.STRING, |
|
|
|
allowNull: true, |
|
|
|
defaultValue: null, |
|
|
|
comment: null, |
|
|
|
primaryKey: false, |
|
|
|
field: "type", |
|
|
|
autoIncrement: false |
|
|
|
}, |
|
|
|
longitude: { |
|
|
|
type: DataTypes.DOUBLE, |
|
|
|
allowNull: true, |
|
|
|
defaultValue: null, |
|
|
|
comment: null, |
|
|
|
primaryKey: false, |
|
|
|
field: "longitude", |
|
|
|
autoIncrement: false |
|
|
|
}, |
|
|
|
latitude: { |
|
|
|
type: DataTypes.DOUBLE, |
|
|
|
allowNull: true, |
|
|
|
defaultValue: null, |
|
|
|
comment: null, |
|
|
|
primaryKey: false, |
|
|
|
field: "latitude", |
|
|
|
autoIncrement: false |
|
|
|
}, |
|
|
|
describe: { |
|
|
|
type: DataTypes.STRING, |
|
|
|
allowNull: true, |
|
|
|
defaultValue: null, |
|
|
|
comment: null, |
|
|
|
primaryKey: false, |
|
|
|
field: "describe", |
|
|
|
autoIncrement: false |
|
|
|
}, |
|
|
|
userId: { |
|
|
|
type: DataTypes.INTEGER, |
|
|
|
allowNull: true, |
|
|
|
defaultValue: null, |
|
|
|
comment: null, |
|
|
|
primaryKey: false, |
|
|
|
field: "user_id", |
|
|
|
autoIncrement: false |
|
|
|
}, |
|
|
|
img: { |
|
|
|
type: DataTypes.ARRAY(DataTypes.STRING), |
|
|
|
allowNull: true, |
|
|
|
defaultValue: null, |
|
|
|
comment: null, |
|
|
|
primaryKey: false, |
|
|
|
field: "img", |
|
|
|
autoIncrement: false |
|
|
|
}, |
|
|
|
qrCode: { |
|
|
|
type: DataTypes.STRING, |
|
|
|
allowNull: true, |
|
|
|
defaultValue: null, |
|
|
|
comment: null, |
|
|
|
primaryKey: false, |
|
|
|
field: "qr_code", |
|
|
|
autoIncrement: false |
|
|
|
}, |
|
|
|
subType: { |
|
|
|
type: DataTypes.STRING, |
|
|
|
allowNull: true, |
|
|
|
defaultValue: null, |
|
|
|
comment: "子类型-子系统", |
|
|
|
primaryKey: false, |
|
|
|
field: "sub_type", |
|
|
|
autoIncrement: false |
|
|
|
} |
|
|
|
}, { |
|
|
|
tableName: "project", |
|
|
|
comment: "", |
|
|
|
indexes: [] |
|
|
|
}); |
|
|
|
dc.models.Project = Project; |
|
|
|
return Project; |
|
|
|
}; |