Browse Source

2.0 数据库更新 user project

master
CODE 1 year ago
parent
commit
d928aad3bb
  1. 200
      api/app/lib/models/project.js

200
api/app/lib/models/project.js

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