Files
wechatWeb/api/model/biz_user.js
张成 60258c6c7d 1
2026-03-26 09:40:55 +08:00

51 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const Sequelize = require("sequelize");
module.exports = (db) => {
const biz_user = db.define(
"biz_user",
{
id: {
type: Sequelize.BIGINT.UNSIGNED,
primaryKey: true,
autoIncrement: true,
},
name: {
type: Sequelize.STRING(100),
allowNull: false,
defaultValue: "",
comment: "姓名/称呼",
},
mobile: {
type: Sequelize.STRING(20),
allowNull: true,
comment: "手机号",
},
email: {
type: Sequelize.STRING(120),
allowNull: true,
},
company_name: {
type: Sequelize.STRING(200),
allowNull: true,
comment: "公司名",
},
status: {
type: Sequelize.ENUM("active", "disabled"),
allowNull: false,
defaultValue: "active",
},
},
{
// 与库表名一致:单数 biz_user与模型名一致避免部分环境下 tableName 未生效时落到默认表名 biz_user
tableName: "biz_user",
freezeTableName: true,
timestamps: false,
underscored: true,
comment: "业务用户",
}
);
// biz_user.sync({ alter: true });
return biz_user;
};