Files
framework_project_web/api/model/sys_tenant.js
张成 cfb92ce33d 12
2026-04-29 14:31:53 +08:00

43 lines
1.0 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");
/** 租户表:用户、角色按 tenant_id 隔离is_platform=1 的租户可管理本表 */
module.exports = (db) => {
const sys_tenant= db.define("sys_tenant", {
name: {
type: Sequelize.STRING(100),
allowNull: false,
defaultValue: "",
comment: "租户名称",
},
code: {
type: Sequelize.STRING(64),
allowNull: false,
defaultValue: "",
unique: true,
comment: "租户编码(登录时与账号一起使用)",
},
remark: {
type: Sequelize.STRING(255),
allowNull: false,
defaultValue: "",
comment: "备注",
},
/** 1 启用 0 停用 */
status: {
type: Sequelize.INTEGER(1),
allowNull: false,
defaultValue: 1,
comment: "状态",
},
/** 1 平台租户:可维护租户表、可代建任意租户用户 */
is_platform: {
type: Sequelize.INTEGER(1),
allowNull: false,
defaultValue: 0,
comment: "是否平台租户",
},
});
return sys_tenant
};