在前后端开发联调前 的提交20260223
This commit is contained in:
49
docs/database/README.md
Normal file
49
docs/database/README.md
Normal file
@@ -0,0 +1,49 @@
|
||||
# docs/database/ — 数据库文档中心
|
||||
|
||||
## DDL 基线(`ddl/` 子目录)
|
||||
|
||||
从测试库自动导出的完整 DDL,按 schema 分文件。重新生成:`python scripts/ops/gen_consolidated_ddl.py`
|
||||
|
||||
| 文件 | 数据库 | Schema | 内容 |
|
||||
|------|--------|--------|------|
|
||||
| `etl_feiqiu__meta.sql` | etl_feiqiu | meta | 调度元数据(3 表) |
|
||||
| `etl_feiqiu__ods.sql` | etl_feiqiu | ods | 原始数据层(23 表) |
|
||||
| `etl_feiqiu__dwd.sql` | etl_feiqiu | dwd | 明细数据层(44 表) |
|
||||
| `etl_feiqiu__core.sql` | etl_feiqiu | core | 跨门店标准化(7 表) |
|
||||
| `etl_feiqiu__dws.sql` | etl_feiqiu | dws | 汇总数据层(32 表 + 1 视图 + 8 物化视图) |
|
||||
| `etl_feiqiu__app.sql` | etl_feiqiu | app | RLS 视图层(7 视图,无表) |
|
||||
| `zqyy_app__public.sql` | zqyy_app | public | 小程序业务表(12 表) |
|
||||
| `fdw.sql` | — | — | FDW 跨库映射配置 |
|
||||
|
||||
## 数据字典(BD_Manual — ODS→DWD 字段映射)
|
||||
|
||||
记录每个 ODS 表到 DWD 表的字段映射、装载方式、业务含义。
|
||||
|
||||
| 文件 | ODS 表 | DWD 表 |
|
||||
|------|--------|--------|
|
||||
| `BD_Manual_assistant_accounts_master.md` | ods.assistant_accounts_master | dwd.dim_assistant / dim_assistant_ex |
|
||||
| `BD_Manual_assistant_service_records.md` | ods.assistant_service_records | dwd.dwd_assistant_service_log* |
|
||||
| `BD_Manual_dws_goods_stock_summary.md` | — | dws.dws_goods_stock_*_summary |
|
||||
| `BD_Manual_goods_stock_movements.md` | ods.goods_stock_movements | dwd.dwd_goods_stock_movement |
|
||||
| `BD_Manual_goods_stock_summary.md` | ods.goods_stock_summary | dwd.dwd_goods_stock_summary |
|
||||
| `BD_Manual_member_balance_changes.md` | ods.member_balance_changes | dwd.dwd_member_balance_change* |
|
||||
| `BD_Manual_recharge_settlements.md` | ods.recharge_settlements | dwd.dwd_recharge_order* |
|
||||
| `BD_Manual_site_tables_master.md` | ods.site_tables_master | dwd.dim_table* |
|
||||
| `BD_Manual_store_goods_master.md` | ods.store_goods_master | dwd.dim_store_goods* |
|
||||
| `BD_Manual_store_goods_sales_records.md` | ods.store_goods_sales_records | dwd.dwd_store_goods_sale* |
|
||||
| `BD_Manual_tenant_goods_master.md` | ods.tenant_goods_master | dwd.dim_tenant_goods* |
|
||||
| `BD_Manual_staff_info_master.md` | ods.staff_info_master | dwd.dim_staff / dim_staff_ex |
|
||||
|
||||
## 归档(`_archived/` 子目录)
|
||||
|
||||
已吸收进 DDL 基线的迁移变更记录,仅供历史参考:
|
||||
- 迁移变更类 BD_Manual(加列、改约束、删表、FDW 变更等)
|
||||
- `etl_feiqiu_schema_migration.md`(旧迁移汇总)
|
||||
- `zqyy_app_admin_web_tables.md`(建表记录)
|
||||
|
||||
## 相关资源
|
||||
|
||||
- 种子数据:`db/etl_feiqiu/seeds/`、`db/zqyy_app/seeds/`
|
||||
- FDW 配置:`db/fdw/`
|
||||
- DDL 生成脚本:`scripts/ops/gen_consolidated_ddl.py`
|
||||
- 迁移脚本归档:`db/_archived/ddl_baseline_2026-02-22/`
|
||||
Reference in New Issue
Block a user