'use strict'; module.exports = app => { const DataTypes = app.Sequelize; const sequelize = app.model; const attributes = { configId: { type: DataTypes.INTEGER(10).UNSIGNED, allowNull: false, defaultValue: null, primaryKey: true, autoIncrement: true, comment: "配置ID", field: "config_id" }, fieldIndex: { type: DataTypes.STRING(100), allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: "索引字段", field: "field_index" }, fieldType: { type: DataTypes.STRING(20), allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: "字段类型仅支持[text,textarea,number,switch,datetime,image,images]", field: "field_type" }, fieldLabel: { type: DataTypes.STRING(20), allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: "表单label", field: "field_label" }, fieldGroup: { type: DataTypes.STRING(50), allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: "所属分组", field: "field_group" }, fieldOptions: { type: DataTypes.STRING(255), allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: "其它选项", field: "field_options" }, fieldDesc: { type: DataTypes.STRING(50), allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: "提示文字", field: "field_desc" }, fieldStatus: { type: DataTypes.INTEGER(1).UNSIGNED, allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: "配置状态", field: "field_status" }, fieldValue: { type: DataTypes.TEXT, allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: "字段值", field: "field_value" }, fieldSort: { type: DataTypes.INTEGER(10).UNSIGNED, allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: "配置排序", field: "field_sort" }, adminId: { type: DataTypes.INTEGER(10).UNSIGNED, allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: "管理员ID", field: "admin_id" }, updateTime: { type: DataTypes.DATE, allowNull: false, defaultValue: sequelize.literal('CURRENT_TIMESTAMP'), primaryKey: false, autoIncrement: false, comment: "更新时间", field: "update_time" }, createTime: { type: DataTypes.DATE, allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: "创建时间", field: "create_time" } }; const options = { tableName: "szj_configs", comment: "", indexes: [{ name: "config_name", unique: false, type: "BTREE", fields: ["field_index"] }] }; const SzjConfigsModel = sequelize.define("szjConfigsModel", attributes, options); return SzjConfigsModel; };