module.exports = (db, DataTypes) => {
  return db.define("bmuser", {
    openId: DataTypes.STRING(100),
    merchantId: { type:DataTypes.STRING(32), field: 'merchant_id', comment:'商户ID'},
    mobile: DataTypes.STRING(30),
    passwd: DataTypes.STRING(64),
    nickname: DataTypes.STRING(64),
    realname: DataTypes.STRING(64),
    headurl: DataTypes.STRING(64),
    balance: DataTypes.INTEGER,
    income: DataTypes.INTEGER,
    agreement: {
      type:DataTypes.BOOLEAN,
      defaultValue: false,
    },
    isAuditor:{ type:DataTypes.INTEGER, field: 'is_auditor', comment:'是否有审核权限 0:没有 1 有'},
  }, {
    paranoid: true, //假的删除
    underscored: true,
    version: true,
    freezeTableName: true,
    //freezeTableName: true,
    // define the table's name
    tableName: 'bm_user',
    validate: {}
  });
}