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.
107 lines
2.9 KiB
107 lines
2.9 KiB
2 years ago
|
/* eslint-disable*/
|
||
|
|
||
|
'use strict';
|
||
|
|
||
|
module.exports = dc => {
|
||
|
const DataTypes = dc.ORM;
|
||
|
const sequelize = dc.orm;
|
||
|
const MetaModel = sequelize.define("metaModel", {
|
||
|
id: {
|
||
|
type: DataTypes.INTEGER,
|
||
|
allowNull: false,
|
||
|
defaultValue: null,
|
||
|
comment: "唯一标识",
|
||
|
primaryKey: true,
|
||
|
field: "id",
|
||
|
autoIncrement: true,
|
||
|
unique: "t_meta_model_id_uindex"
|
||
|
},
|
||
|
modelType: {
|
||
|
type: DataTypes.STRING,
|
||
|
allowNull: false,
|
||
|
defaultValue: null,
|
||
|
comment: "元模型类型",
|
||
|
primaryKey: false,
|
||
|
field: "model_type",
|
||
|
autoIncrement: false
|
||
|
},
|
||
|
attributeName: {
|
||
|
type: DataTypes.STRING,
|
||
|
allowNull: false,
|
||
|
defaultValue: null,
|
||
|
comment: "属性名称",
|
||
|
primaryKey: false,
|
||
|
field: "attribute_name",
|
||
|
autoIncrement: false
|
||
|
},
|
||
|
attributeCode: {
|
||
|
type: DataTypes.STRING,
|
||
|
allowNull: false,
|
||
|
defaultValue: null,
|
||
|
comment: "属性代码",
|
||
|
primaryKey: false,
|
||
|
field: "attribute_code",
|
||
|
autoIncrement: false
|
||
|
},
|
||
|
dataType: {
|
||
|
type: DataTypes.STRING,
|
||
|
allowNull: false,
|
||
|
defaultValue: null,
|
||
|
comment: "数据类型",
|
||
|
primaryKey: false,
|
||
|
field: "data_type",
|
||
|
autoIncrement: false
|
||
|
},
|
||
|
length: {
|
||
|
type: DataTypes.INTEGER,
|
||
|
allowNull: true,
|
||
|
defaultValue: null,
|
||
|
comment: "长度",
|
||
|
primaryKey: false,
|
||
|
field: "length",
|
||
|
autoIncrement: false
|
||
|
},
|
||
|
control: {
|
||
|
type: DataTypes.STRING,
|
||
|
allowNull: false,
|
||
|
defaultValue: null,
|
||
|
comment: "输入控件",
|
||
|
primaryKey: false,
|
||
|
field: "control",
|
||
|
autoIncrement: false
|
||
|
},
|
||
|
nullable: {
|
||
|
type: DataTypes.BOOLEAN,
|
||
|
allowNull: false,
|
||
|
defaultValue: null,
|
||
|
comment: "是否允许为空",
|
||
|
primaryKey: false,
|
||
|
field: "nullable",
|
||
|
autoIncrement: false
|
||
|
},
|
||
|
readOnly: {
|
||
|
type: DataTypes.BOOLEAN,
|
||
|
allowNull: false,
|
||
|
defaultValue: null,
|
||
|
comment: "是否只读",
|
||
|
primaryKey: false,
|
||
|
field: "read_only",
|
||
|
autoIncrement: false
|
||
|
},
|
||
|
description: {
|
||
|
type: DataTypes.STRING,
|
||
|
allowNull: true,
|
||
|
defaultValue: null,
|
||
|
comment: "描述",
|
||
|
primaryKey: false,
|
||
|
field: "description",
|
||
|
autoIncrement: false
|
||
|
}
|
||
|
}, {
|
||
|
tableName: "t_meta_model",
|
||
|
comment: "",
|
||
|
indexes: []
|
||
|
});
|
||
|
dc.models.MetaModel = MetaModel;
|
||
|
return MetaModel;
|
||
|
};
|