123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- '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;
- };
|