72 lines
3.3 KiB
Markdown
72 lines
3.3 KiB
Markdown
# B. 数据库表结构速查
|
||
|
||
:::tip 说明
|
||
25 张 `gin_` 表。所有表统一带公共审计列:`create_user / create_time / update_user / update_time / del_flag`;租户级表(标 ※)另含 `tenant_id`(白名单 9 张:user/user_role/role/dept/level/position/article/category/notice/link)。
|
||
:::
|
||
|
||
## 组织权限
|
||
|
||
| 表 | 业务列(除公共列) |
|
||
|---|---|
|
||
| gin_user ※ | tenant_id, code, realname, gender, avatar, mobile, email, dept_id, level_id, position_id, province_code, city_code, district_code, street_code, city_info, address, username, password, salt, intro, status, sort, note |
|
||
| gin_user_role ※ | tenant_id, user_id, role_id |
|
||
| gin_role ※ | tenant_id, name, data_scope, code, sort, note |
|
||
| gin_role_menu ※ | tenant_id, role_id, menu_id |
|
||
| gin_menu | name, icon, icon2, parent_id, path, component, permission, target, type, status, hide, sort, note |
|
||
| gin_dept ※ | tenant_id, name, type, parent_id, sort, note |
|
||
| gin_level ※ | tenant_id, name, status, sort |
|
||
| gin_position ※ | tenant_id, name, status, sort |
|
||
| gin_tenant | name, code, contact, mobile, email, address, logo, status, expire_time, max_user_num, note |
|
||
|
||
## 内容管理
|
||
|
||
| 表 | 业务列 |
|
||
|---|---|
|
||
| gin_article ※ | tenant_id, category_id, title, cover, images, intro, content, author, status, click, sort |
|
||
| gin_category ※ | tenant_id, category_name, category_code, parent_id, sort, note |
|
||
| gin_notice ※ | tenant_id, title, cover, type, click_num, status, content |
|
||
| gin_link ※ | tenant_id, name, type, url, form, image, status, sort, note |
|
||
|
||
## 数据与配置
|
||
|
||
| 表 | 业务列 |
|
||
|---|---|
|
||
| gin_dict | name, code, sort, note |
|
||
| gin_dict_item | name, value, dict_id, sort, note |
|
||
| gin_param | name, code, value, type, status, sort, note |
|
||
| gin_config | name, code, sort, note |
|
||
| gin_config_item | name, code, value, options, config_id, type, status, sort, note |
|
||
| gin_city | city_code, area_code, parent_code, zip_code, level, pid, name, short_name, full_name, pinyin, lng, lat |
|
||
|
||
## 任务与日志
|
||
|
||
| 表 | 业务列 |
|
||
|---|---|
|
||
| gin_job | job_name, job_alias, job_group, job_trigger, status, cron_expression, execute_policy, is_sync, url, params, note |
|
||
| gin_job_log | job_id, job_name, job_group, job_trigger, job_message, cron_expression, status, start_time, end_time, consume_time, exception_info |
|
||
| gin_operation_log | title, type, source, method, request_method, url, param, result, ip, location, os, browser, consume_time, status, error |
|
||
| gin_login_log | username, log_type, source, method, request_method, url, param, result, ip, location, os, browser, consume_time, status, error |
|
||
|
||
## 工具
|
||
|
||
| 表 | 业务列 |
|
||
|---|---|
|
||
| gin_file_template | name, code, file_name, file_path, note, sort |
|
||
| gin_example | name, avatar, type, status, sort |
|
||
|
||
## 关键列语义
|
||
|
||
| 列 | 语义 |
|
||
|---|---|
|
||
| del_flag | 0 正常 / 1 已删除(全局钩子与 Scope 执行) |
|
||
| data_scope | 角色数据范围:1 全部 / 2 本部门及以下 / 3 本部门 / 4 仅本人 |
|
||
| gin_menu.permission | 权限节点码(sys:模块:操作) |
|
||
| gin_menu.type | 0-菜单(页面)1-节点(纯权限点) |
|
||
| gin_job.url | 任务处理器注册名(数据驱动查找) |
|
||
| gin_user.password / salt | bcrypt(password+salt),salt 独立存储 |
|
||
|
||
## 相关
|
||
|
||
- [4.10 数据库设计](/zh/architecture/database-design.html)
|
||
- [2.2 数据库初始化](/zh/quickstart/database-init.html)
|