const system = require("../../system");
const settings = require("../../../config/settings");
const uiconfig = system.getUiConfig2(settings.wxconfig.appId);
module.exports = (db, DataTypes) => {
  var base = require("../basemodel/codenamebase")(db, DataTypes);
  return db.define("companyauthcode", Object.assign({
    //基类name暂时没有用到
    //基类code为授权码
    macAddr: DataTypes.STRING,//mac地址
    resetNum: DataTypes.INTEGER,//重置次数
    sortNum: {//排序号,默认为0
      type: DataTypes.INTEGER,
      allowNull: true,
      defaultValue: 0,
    },
    isEnable: {//是否启用，0不启用，1启用，默认为1
      type: DataTypes.BOOLEAN,
      allowNull: true,
      defaultValue: true,
    },
  }, base), {
      paranoid: true,//假的删除
      underscored: true,
      version: true,
      freezeTableName: true,
      //freezeTableName: true,
      // define the table's name
      tableName: 'biz_companyauthcode',
      validate: {
      }
    });
}
