Skip to content

Database Design ​

Independent table design — existing erupt business tables are unaffected. Tables and menus are created and initialized automatically on startup, with no SQL scripts to run.

Shared Tenant Tables (maintained on the super-admin side) ​

TableDescription
e_tenant_configTenant config: enterprise ID (unique), tenant name, contact, status, expire date, admin account, domain, logo, tenant CSS / JS
e_tenant_config_packageTenant–package association table
e_tenant_menuTenant menus: tree structure with unique menu codes; initialized automatically on startup with button-level menus generated per erupt class permissions
e_tenant_packageTenant packages: define a set of menu capabilities granted to tenants per package
e_tenant_package_menuPackage–menu association table

In-tenant Tables (row-level isolation by tenant_id) ​

TableDescription
t_e_upms_userTenant users: unique constraint on tenant_id + account; supports password encryption (MD5 + salt by default), IP whitelist, account expiry, and tenant-admin flag
t_e_upms_user_roleUser–role association table
t_e_upms_roleTenant roles: unique constraint on tenant_id + code; menu permissions can only be selected from menus in the tenant's active packages
t_e_upms_role_menuRole–menu association table
t_e_upms_orgTenant organizations: tree structure with unique constraint on tenant_id + code

Business Tables ​

Business tables annotated with @EruptTenant or extending the TenantBaseModel family automatically carry the tenant field (default tenant_id), with row-level isolation handled by the framework. Creating an index on the tenant field is recommended:

java
@Table(
    name = "t_tenant_demo",
    indexes = @Index(columnList = EruptTenant.TENANT_FIELD)
)

See Multi-tenant Development for isolation behavior details.

Contributors

The avatar of contributor named as YuePeng YuePeng
The avatar of contributor named as Claude Fable 5.1 Claude Fable 5.1

Changelog

Released under the Apache-2.0 License.