Files
Neo-ZQYY/docs/database/README.md

50 lines
2.7 KiB
Markdown
Raw Permalink 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.
# 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/`