feat: batch update - gift card breakdown spec, backend APIs, miniprogram pages, ETL finance recharge, docs & migrations
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
# BD_Manual:app Schema 与 RLS 视图层
|
||||
|
||||
> 目标库:`test_etl_feiqiu`(通过 `PG_DSN` 连接)
|
||||
> 迁移脚本:`db/etl_feiqiu/migrations/2026-02-24__p1_create_app_schema_rls_views.sql`
|
||||
> 迁移脚本:`db/etl_feiqiu/migrations/2026-02-24__p1_create_app_schema_rls_views.sql`、`db/etl_feiqiu/migrations/2026-03-19_add_board_rls_views.sql`
|
||||
> DDL 位置:`docs/database/ddl/etl_feiqiu__app.sql`(执行后需重新生成)
|
||||
> 关联 SPEC:`miniapp-db-foundation`(P1 基础设施层)
|
||||
> 关联 SPEC:`miniapp-db-foundation`(P1 基础设施层)、`rns1-board-apis`(BOARD 看板)
|
||||
|
||||
---
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
### 新增角色
|
||||
- `app_reader`:只读角色(`LOGIN`),拥有 `app` Schema 的 `USAGE` + `SELECT` 权限
|
||||
|
||||
### 新增视图(35 张)
|
||||
### 新增视图(38 张)
|
||||
|
||||
**DWD 层(11 张,全部含 `site_id` 过滤):**
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
| `app.v_dim_staff` | `dwd.dim_staff` | 同上 |
|
||||
| `app.v_dim_staff_ex` | `dwd.dim_staff_ex` | 同上 |
|
||||
|
||||
**DWS 层 — 含 `site_id` 过滤(20 张):**
|
||||
**DWS 层 — 含 `site_id` 过滤(23 张):**
|
||||
|
||||
| 视图 | 源表 |
|
||||
|------|------|
|
||||
@@ -57,6 +57,9 @@
|
||||
| `app.v_dws_platform_settlement` | `dws.dws_platform_settlement` |
|
||||
| `app.v_dws_assistant_recharge_commission` | `dws.dws_assistant_recharge_commission` |
|
||||
| `app.v_dws_order_summary` | `dws.dws_order_summary` |
|
||||
| `app.v_dws_assistant_project_tag` | `dws.dws_assistant_project_tag` |
|
||||
| `app.v_dws_member_project_tag` | `dws.dws_member_project_tag` |
|
||||
| `app.v_dws_member_spending_power_index` | `dws.dws_member_spending_power_index` |
|
||||
|
||||
**DWS 层 — cfg_* 配置表(4 张,无 `site_id`,直接 `SELECT *`):**
|
||||
|
||||
@@ -74,9 +77,10 @@
|
||||
| `app_reader` | `app` | `USAGE` + `SELECT ON ALL TABLES` + `ALTER DEFAULT PRIVILEGES` |
|
||||
|
||||
### P2 预留(注释形式,暂不创建)
|
||||
- `dws.dws_member_spending_power_index` → `app.v_dws_member_spending_power_index`
|
||||
- `dws.dws_assistant_order_contribution` → `app.v_dws_assistant_order_contribution`
|
||||
|
||||
> `v_dws_member_spending_power_index`、`v_dws_assistant_project_tag`、`v_dws_member_project_tag` 已于 2026-03-19 正式创建(迁移脚本 `2026-03-19_add_board_rls_views.sql`)。
|
||||
|
||||
---
|
||||
|
||||
## 2. 兼容性影响
|
||||
@@ -113,7 +117,7 @@ DROP ROLE IF EXISTS app_reader;
|
||||
-- 1. 验证 app Schema 存在
|
||||
SELECT schema_name FROM information_schema.schemata WHERE schema_name = 'app';
|
||||
|
||||
-- 2. 验证视图数量(应为 35 张)
|
||||
-- 2. 验证视图数量(应为 38 张:原 35 + 2026-03-19 新增 3)
|
||||
SELECT count(*) FROM information_schema.views WHERE table_schema = 'app';
|
||||
|
||||
-- 3. 验证 app_reader 角色存在且有 app Schema 权限
|
||||
|
||||
Reference in New Issue
Block a user