feat: 2026-04-15~05-02 累积变更基线 — AI 重构 + Runtime Context + DWS 修复

涵盖(每条对应已存的审计记录):
- AI 模块拆分:apps/backend/app/ai/apps -> prompts/(8 个 APP + app2a 派生)
  audit: 2026-04-20__ai-module-complete.md
- admin-web AI 管理套件:AIDashboard / AIOperations / AIRunLogs / AITriggers / TriggerManager
  audit: 2026-04-21__admin-web-ai-management-suite.md
- App2 财务洞察 prompt v3 -> v5.1 + 小程序 AI 接入(chat / board-finance)
  audit: 2026-04-22__app2_prompt_v5_1_and_miniprogram_ai_insight.md
- App2 prewarm 全过滤器 + AI 触发器 cron reschedule
  audit: 2026-04-21__app2-finance-prewarm-all-filters.md
  migration: 20260420_ai_trigger_jobs_and_app2_prewarm.sql / 20260421_app2_prewarm_cron_reschedule.sql
- AppType 联合类型对齐 + adminAiAppTypes.test.ts
  audit: 2026-04-30__admin_web_ai_app_type_alignment.md
- DashScope tokens_used 提取修复
  audit: 2026-04-30__backend_dashscope_tokens_used_extraction.md
- App3 线索完整详情 prompt
  audit: 2026-05-01__backend_app3_full_detail_prompt.md
- Runtime Context 沙箱(5-1~5-2 主线):
  - 后端 schema/service + admin_runtime_context / xcx_runtime_clock 两个 router
  - admin-web RuntimeContext.tsx + miniprogram runtime-clock.ts
  - migration: 20260501__runtime_context_sandbox.sql
  - tools/db/verify_admin_web_sandbox.py + verify_sandbox_end_to_end.py
  - database/changes: 7 份 sandbox_* 验证报告
- 飞球 DWS 修复:finance_area_daily 区域汇总 + task_engine 调整
  + RLS 视图业务日上界(migration 20260502 + scripts/ops/gen_rls_business_date_migration.py)

合规:
- .gitignore 启用 tmp/ 排除
- 不入仓:apps/etl/connectors/feiqiu/.env(API_TOKEN secret,本地修改保留)

待验证清单:
- docs/audit/changes/2026-05-04__cumulative_baseline_pending_verification.md
  每个主题的功能完整性 / 上线验证几乎都未收口,按优先级 P0~P3 逐一处理
This commit is contained in:
Neo
2026-05-04 02:30:19 +08:00
parent 2010034840
commit caf179a5da
130 changed files with 14543 additions and 2717 deletions

View File

@@ -1,6 +1,6 @@
-- =============================================================================
-- etl_feiqiu / appRLS 视图层)
-- 生成日期2026-04-12
-- 生成日期2026-05-02
-- 来源:测试库(通过脚本自动导出)
-- =============================================================================
@@ -36,7 +36,8 @@ SELECT id,
unique_customers,
unique_tables,
created_at
FROM dws.dws_assistant_daily_detail d;
FROM dws.dws_assistant_daily_detail d
WHERE (stat_date <= app.business_date_now());
;
CREATE OR REPLACE VIEW app.v_cfg_area_category AS
@@ -61,7 +62,8 @@ SELECT price_id,
description,
created_at,
updated_at
FROM dws.cfg_assistant_level_price;
FROM dws.cfg_assistant_level_price
WHERE ((effective_from <= app.business_date_now()) AND (effective_to >= app.business_date_now()));
;
CREATE OR REPLACE VIEW app.v_cfg_bonus_rules AS
@@ -112,7 +114,8 @@ SELECT tier_id,
description,
created_at,
updated_at
FROM dws.cfg_performance_tier;
FROM dws.cfg_performance_tier
WHERE ((effective_from <= app.business_date_now()) AND (effective_to >= app.business_date_now()));
;
CREATE OR REPLACE VIEW app.v_dim_assistant AS
@@ -301,7 +304,7 @@ SELECT assistant_service_id,
is_delete,
real_service_money
FROM dwd.dwd_assistant_service_log
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint);
WHERE ((site_id = (current_setting('app.current_site_id'::text))::bigint) AND (COALESCE((create_time)::date, '0001-01-01'::date) <= app.business_date_now()));
;
CREATE OR REPLACE VIEW app.v_dwd_recharge_order AS
@@ -330,7 +333,7 @@ SELECT recharge_order_id,
real_electricity_money,
electricity_adjust_money
FROM dwd.dwd_recharge_order
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint);
WHERE ((site_id = (current_setting('app.current_site_id'::text))::bigint) AND (COALESCE((pay_time)::date, '0001-01-01'::date) <= app.business_date_now()));
;
CREATE OR REPLACE VIEW app.v_dwd_settlement_head AS
@@ -372,7 +375,7 @@ SELECT order_settle_id,
pl_coupon_sale_amount,
mervou_sales_amount
FROM dwd.dwd_settlement_head
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint);
WHERE ((site_id = (current_setting('app.current_site_id'::text))::bigint) AND (COALESCE((create_time)::date, '0001-01-01'::date) <= app.business_date_now()));
;
CREATE OR REPLACE VIEW app.v_dwd_store_goods_sale AS
@@ -402,7 +405,7 @@ SELECT store_goods_sale_id,
coupon_share_money,
discount_price
FROM dwd.dwd_store_goods_sale
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint);
WHERE ((site_id = (current_setting('app.current_site_id'::text))::bigint) AND (COALESCE((create_time)::date, '0001-01-01'::date) <= app.business_date_now()));
;
CREATE OR REPLACE VIEW app.v_dwd_table_fee_log AS
@@ -436,7 +439,7 @@ SELECT table_fee_log_id,
activity_discount_amount,
real_service_money
FROM dwd.dwd_table_fee_log
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint);
WHERE ((site_id = (current_setting('app.current_site_id'::text))::bigint) AND (COALESCE((create_time)::date, '0001-01-01'::date) <= app.business_date_now()));
;
CREATE OR REPLACE VIEW app.v_dws_assistant_customer_stats AS
@@ -518,7 +521,7 @@ SELECT id,
is_exempt,
per_hour_contribution
FROM dws.dws_assistant_daily_detail
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint);
WHERE ((site_id = (current_setting('app.current_site_id'::text))::bigint) AND (stat_date <= app.business_date_now()));
;
CREATE OR REPLACE VIEW app.v_dws_assistant_finance_analysis AS
@@ -543,7 +546,7 @@ SELECT id,
created_at,
updated_at
FROM dws.dws_assistant_finance_analysis
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint);
WHERE ((site_id = (current_setting('app.current_site_id'::text))::bigint) AND (stat_date <= app.business_date_now()));
;
CREATE OR REPLACE VIEW app.v_dws_assistant_monthly_summary AS
@@ -583,7 +586,7 @@ SELECT id,
created_at,
updated_at
FROM dws.dws_assistant_monthly_summary
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint);
WHERE ((site_id = (current_setting('app.current_site_id'::text))::bigint) AND (stat_month <= (date_trunc('month'::text, (app.business_date_now())::timestamp with time zone))::date));
;
CREATE OR REPLACE VIEW app.v_dws_assistant_order_contribution AS
@@ -687,7 +690,7 @@ SELECT id,
created_at,
updated_at
FROM dws.dws_assistant_salary_calc
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint);
WHERE ((site_id = (current_setting('app.current_site_id'::text))::bigint) AND (salary_month <= (date_trunc('month'::text, (app.business_date_now())::timestamp with time zone))::date));
;
CREATE OR REPLACE VIEW app.v_dws_coach_area_hours AS
@@ -746,9 +749,10 @@ SELECT id,
renewal_cash,
order_count,
created_at,
updated_at
updated_at,
member_order_count
FROM dws.dws_finance_area_daily
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint);
WHERE ((site_id = (current_setting('app.current_site_id'::text))::bigint) AND (stat_date <= app.business_date_now()));
;
CREATE OR REPLACE VIEW app.v_dws_finance_board_cache AS
@@ -822,7 +826,7 @@ SELECT id,
created_at,
updated_at
FROM dws.dws_finance_daily_summary
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint);
WHERE ((site_id = (current_setting('app.current_site_id'::text))::bigint) AND (stat_date <= app.business_date_now()));
;
CREATE OR REPLACE VIEW app.v_dws_finance_discount_detail AS
@@ -839,7 +843,7 @@ SELECT id,
created_at,
updated_at
FROM dws.dws_finance_discount_detail
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint);
WHERE ((site_id = (current_setting('app.current_site_id'::text))::bigint) AND (stat_date <= app.business_date_now()));
;
CREATE OR REPLACE VIEW app.v_dws_finance_expense_summary AS
@@ -860,7 +864,7 @@ SELECT id,
created_at,
updated_at
FROM dws.dws_finance_expense_summary
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint);
WHERE ((site_id = (current_setting('app.current_site_id'::text))::bigint) AND (expense_month <= (date_trunc('month'::text, (app.business_date_now())::timestamp with time zone))::date));
;
CREATE OR REPLACE VIEW app.v_dws_finance_income_structure AS
@@ -878,7 +882,7 @@ SELECT id,
created_at,
updated_at
FROM dws.dws_finance_income_structure
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint);
WHERE ((site_id = (current_setting('app.current_site_id'::text))::bigint) AND (stat_date <= app.business_date_now()));
;
CREATE OR REPLACE VIEW app.v_dws_finance_recharge_summary AS
@@ -912,7 +916,7 @@ SELECT id,
created_at,
updated_at
FROM dws.dws_finance_recharge_summary
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint);
WHERE ((site_id = (current_setting('app.current_site_id'::text))::bigint) AND (stat_date <= app.business_date_now()));
;
CREATE OR REPLACE VIEW app.v_dws_member_assistant_intimacy AS
@@ -1033,7 +1037,7 @@ SELECT DISTINCT ON (member_id) id,
recharge_amount_90d,
avg_ticket_amount
FROM dws.dws_member_consumption_summary
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint)
WHERE ((site_id = (current_setting('app.current_site_id'::text))::bigint) AND (stat_date <= app.business_date_now()))
ORDER BY member_id, stat_date DESC;
;
@@ -1162,7 +1166,7 @@ SELECT id,
created_at,
updated_at
FROM dws.dws_member_visit_detail
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint);
WHERE ((site_id = (current_setting('app.current_site_id'::text))::bigint) AND (visit_date <= app.business_date_now()));
;
CREATE OR REPLACE VIEW app.v_dws_member_winback_index AS
@@ -1204,7 +1208,7 @@ SELECT DISTINCT ON (member_id) winback_id,
ideal_next_visit_date,
stat_date
FROM dws.dws_member_winback_index
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint)
WHERE ((site_id = (current_setting('app.current_site_id'::text))::bigint) AND (COALESCE((last_visit_time)::date, '0001-01-01'::date) <= app.business_date_now()))
ORDER BY member_id, stat_date DESC;
;

View File

@@ -1,6 +1,6 @@
-- =============================================================================
-- etl_feiqiu / core跨门店标准化维度/事实)
-- 生成日期2026-04-12
-- 生成日期2026-05-02
-- 来源:测试库(通过脚本自动导出)
-- =============================================================================

View File

@@ -1,6 +1,6 @@
-- =============================================================================
-- etl_feiqiu / dwd明细数据层
-- 生成日期2026-04-12
-- 生成日期2026-05-02
-- 来源:测试库(通过脚本自动导出)
-- =============================================================================
@@ -695,7 +695,13 @@ CREATE TABLE dwd.dwd_groupbuy_redemption (
ledger_name character varying(128),
create_time timestamp with time zone,
member_discount_money numeric(18,2),
coupon_sale_id bigint
coupon_sale_id bigint,
mt_settlement_price numeric(14,2),
mt_gross_income numeric(14,2),
mt_service_fee numeric(14,2),
mt_marketing_fee numeric(14,2),
mt_other_adjust numeric(14,2),
mt_import_time timestamp with time zone
);
CREATE TABLE dwd.dwd_groupbuy_redemption_ex (

View File

@@ -1,6 +1,6 @@
-- =============================================================================
-- etl_feiqiu / dws汇总数据层
-- 生成日期2026-04-12
-- 生成日期2026-05-02
-- 来源:测试库(通过脚本自动导出)
-- =============================================================================
@@ -421,7 +421,8 @@ CREATE TABLE dws.dws_finance_area_daily (
renewal_cash numeric(14,2) DEFAULT 0 NOT NULL,
order_count integer DEFAULT 0 NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone DEFAULT now() NOT NULL
updated_at timestamp with time zone DEFAULT now() NOT NULL,
member_order_count integer DEFAULT 0 NOT NULL
);
CREATE TABLE dws.dws_finance_board_cache (
@@ -1259,7 +1260,8 @@ SELECT id,
renewal_cash,
order_count,
created_at,
updated_at
updated_at,
member_order_count
FROM dws.dws_finance_area_daily
WHERE (site_id = (current_setting('app.current_site_id'::text))::bigint);
;

View File

@@ -1,6 +1,6 @@
-- =============================================================================
-- etl_feiqiu / metaETL 调度元数据)
-- 生成日期2026-04-12
-- 生成日期2026-05-02
-- 来源:测试库(通过脚本自动导出)
-- =============================================================================

View File

@@ -1,6 +1,6 @@
-- =============================================================================
-- etl_feiqiu / ods原始数据层
-- 生成日期2026-04-12
-- 生成日期2026-05-02
-- 来源:测试库(通过脚本自动导出)
-- =============================================================================

View File

@@ -1,6 +1,6 @@
-- =============================================================================
-- FDW 跨库映射(在 zqyy_app 中执行)
-- 生成日期2026-04-12
-- 生成日期2026-05-02
-- 来源db/fdw/setup_fdw.sql
-- =============================================================================

View File

@@ -1,6 +1,6 @@
-- =============================================================================
-- zqyy_app / auth用户认证与权限
-- 生成日期2026-04-12
-- 生成日期2026-05-02
-- 来源:测试库(通过脚本自动导出)
-- =============================================================================

View File

@@ -1,6 +1,6 @@
-- =============================================================================
-- zqyy_app / biz核心业务表任务/备注/触发器))
-- 生成日期2026-04-12
-- 生成日期2026-05-02
-- 来源:测试库(通过脚本自动导出)
-- =============================================================================
@@ -41,7 +41,9 @@ CREATE TABLE biz.ai_cache (
triggered_by character varying(100),
created_at timestamp with time zone DEFAULT now() NOT NULL,
expires_at timestamp with time zone,
status character varying(20) DEFAULT 'valid'::character varying
status character varying(20) DEFAULT 'valid'::character varying,
runtime_mode character varying(20) DEFAULT 'live'::character varying NOT NULL,
sandbox_instance_id character varying(64) DEFAULT 'live'::character varying NOT NULL
);
CREATE TABLE biz.ai_conversations (
@@ -86,7 +88,9 @@ CREATE TABLE biz.ai_run_logs (
session_id character varying(100),
created_at timestamp with time zone DEFAULT now() NOT NULL,
finished_at timestamp with time zone,
alert_status character varying(20) DEFAULT NULL::character varying
alert_status character varying(20) DEFAULT NULL::character varying,
runtime_mode character varying(20) DEFAULT 'live'::character varying NOT NULL,
sandbox_instance_id character varying(64) DEFAULT 'live'::character varying NOT NULL
);
CREATE TABLE biz.ai_trigger_jobs (
@@ -102,7 +106,9 @@ CREATE TABLE biz.ai_trigger_jobs (
started_at timestamp with time zone,
finished_at timestamp with time zone,
error_message text,
created_at timestamp with time zone DEFAULT now() NOT NULL
created_at timestamp with time zone DEFAULT now() NOT NULL,
runtime_mode character varying(20) DEFAULT 'live'::character varying NOT NULL,
sandbox_instance_id character varying(64) DEFAULT 'live'::character varying NOT NULL
);
CREATE TABLE biz.cfg_task_generator_params (
@@ -124,7 +130,9 @@ CREATE TABLE biz.coach_task_history (
old_task_type character varying(50),
new_task_type character varying(50),
detail jsonb,
created_at timestamp with time zone DEFAULT now()
created_at timestamp with time zone DEFAULT now(),
runtime_mode character varying(20) DEFAULT 'live'::character varying NOT NULL,
sandbox_instance_id character varying(64) DEFAULT 'live'::character varying NOT NULL
);
CREATE TABLE biz.coach_task_transfer_log (
@@ -138,7 +146,9 @@ CREATE TABLE biz.coach_task_transfer_log (
transfer_reason text,
guard_checks jsonb,
transfer_score numeric,
created_at timestamp with time zone DEFAULT now() NOT NULL
created_at timestamp with time zone DEFAULT now() NOT NULL,
runtime_mode character varying(20) DEFAULT 'live'::character varying NOT NULL,
sandbox_instance_id character varying(64) DEFAULT 'live'::character varying NOT NULL
);
CREATE TABLE biz.coach_tasks (
@@ -160,7 +170,9 @@ CREATE TABLE biz.coach_tasks (
transfer_count integer DEFAULT 0 NOT NULL,
transferred_from bigint,
transferred_at timestamp with time zone,
completion_type character varying(10)
completion_type character varying(10),
runtime_mode character varying(20) DEFAULT 'live'::character varying NOT NULL,
sandbox_instance_id character varying(64) DEFAULT 'live'::character varying NOT NULL
);
CREATE TABLE biz.connectors (
@@ -229,7 +241,9 @@ CREATE TABLE biz.recall_events (
pay_time timestamp with time zone NOT NULL,
task_id bigint,
task_type character varying(50),
created_at timestamp with time zone DEFAULT now()
created_at timestamp with time zone DEFAULT now(),
runtime_mode character varying(20) DEFAULT 'live'::character varying NOT NULL,
sandbox_instance_id character varying(64) DEFAULT 'live'::character varying NOT NULL
);
CREATE TABLE biz.salary_adjustments (
@@ -256,6 +270,19 @@ CREATE TABLE biz.site_code_history (
retired_at timestamp with time zone
);
CREATE TABLE biz.site_runtime_context (
site_id bigint NOT NULL,
mode character varying(20) DEFAULT 'live'::character varying NOT NULL,
sandbox_date date,
sandbox_instance_id character varying(64),
ai_mode character varying(20) DEFAULT 'live'::character varying NOT NULL,
status character varying(20) DEFAULT 'active'::character varying NOT NULL,
reason text,
updated_by bigint,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone DEFAULT now() NOT NULL
);
CREATE TABLE biz.sites (
id integer DEFAULT nextval('biz.sites_id_seq'::regclass) NOT NULL,
tenant_id integer NOT NULL,
@@ -360,6 +387,8 @@ ALTER TABLE biz.salary_adjustments ADD CONSTRAINT salary_adjustments_upload_batc
ALTER TABLE biz.salary_adjustments ADD CONSTRAINT salary_adjustments_pkey PRIMARY KEY (id);
ALTER TABLE biz.site_code_history ADD CONSTRAINT site_code_history_pkey PRIMARY KEY (id);
ALTER TABLE biz.site_code_history ADD CONSTRAINT site_code_history_site_code_key UNIQUE (site_code);
ALTER TABLE biz.site_runtime_context ADD CONSTRAINT site_runtime_context_site_id_fkey FOREIGN KEY (site_id) REFERENCES biz.sites(site_id);
ALTER TABLE biz.site_runtime_context ADD CONSTRAINT site_runtime_context_pkey PRIMARY KEY (site_id);
ALTER TABLE biz.sites ADD CONSTRAINT sites_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES biz.tenants(id);
ALTER TABLE biz.sites ADD CONSTRAINT sites_pkey PRIMARY KEY (id);
ALTER TABLE biz.sites ADD CONSTRAINT sites_site_code_key UNIQUE (site_code);
@@ -379,6 +408,7 @@ ALTER TABLE biz.trigger_jobs ADD CONSTRAINT trigger_jobs_job_name_key UNIQUE (jo
-- 索引
CREATE INDEX idx_ai_cache_cleanup ON biz.ai_cache USING btree (cache_type, site_id, target_id, created_at);
CREATE INDEX idx_ai_cache_lookup ON biz.ai_cache USING btree (cache_type, site_id, target_id, created_at DESC);
CREATE INDEX idx_ai_cache_runtime_lookup ON biz.ai_cache USING btree (cache_type, site_id, runtime_mode, sandbox_instance_id, target_id, created_at DESC);
CREATE INDEX idx_ai_conv_app_site ON biz.ai_conversations USING btree (app_id, site_id, created_at DESC);
CREATE INDEX idx_ai_conv_context ON biz.ai_conversations USING btree (user_id, site_id, context_type, context_id, last_message_at DESC NULLS LAST) WHERE (context_type IS NOT NULL);
CREATE INDEX idx_ai_conv_last_msg ON biz.ai_conversations USING btree (user_id, site_id, last_message_at DESC NULLS LAST);
@@ -390,18 +420,20 @@ CREATE INDEX idx_ai_run_logs_created_brin ON biz.ai_run_logs USING brin (created
CREATE INDEX idx_ai_run_logs_site_app ON biz.ai_run_logs USING btree (site_id, app_type);
CREATE INDEX idx_ai_run_logs_status ON biz.ai_run_logs USING btree (status);
CREATE INDEX idx_ai_trigger_jobs_dedup ON biz.ai_trigger_jobs USING btree (event_type, member_id, site_id, created_at) WHERE ((status)::text <> 'skipped_duplicate'::text);
CREATE INDEX idx_ai_trigger_jobs_runtime_site ON biz.ai_trigger_jobs USING btree (site_id, runtime_mode, sandbox_instance_id, event_type, status);
CREATE INDEX idx_ai_trigger_jobs_site ON biz.ai_trigger_jobs USING btree (site_id, event_type);
CREATE INDEX idx_ai_trigger_jobs_status ON biz.ai_trigger_jobs USING btree (status);
CREATE INDEX idx_transfer_log_member ON biz.coach_task_transfer_log USING btree (member_id, created_at DESC);
CREATE INDEX idx_transfer_log_site_created ON biz.coach_task_transfer_log USING btree (site_id, created_at DESC);
CREATE INDEX idx_coach_tasks_assistant_status ON biz.coach_tasks USING btree (site_id, assistant_id, status);
CREATE UNIQUE INDEX idx_coach_tasks_site_assistant_member_type ON biz.coach_tasks USING btree (site_id, assistant_id, member_id, task_type) WHERE ((status)::text = 'active'::text);
CREATE INDEX idx_coach_tasks_runtime_assistant_status ON biz.coach_tasks USING btree (site_id, runtime_mode, sandbox_instance_id, assistant_id, status);
CREATE UNIQUE INDEX idx_coach_tasks_runtime_unique_active ON biz.coach_tasks USING btree (site_id, assistant_id, member_id, task_type, runtime_mode, sandbox_instance_id) WHERE ((status)::text = 'active'::text);
CREATE INDEX idx_task_monthly_assistant ON biz.dws_assistant_task_monthly USING btree (assistant_id, stat_month DESC);
CREATE INDEX idx_task_monthly_site_month ON biz.dws_assistant_task_monthly USING btree (site_id, stat_month DESC);
CREATE INDEX idx_excel_log_site ON biz.excel_upload_log USING btree (site_id, created_at DESC);
CREATE INDEX idx_notes_target ON biz.notes USING btree (site_id, target_type, target_id);
CREATE INDEX idx_recall_events_assistant_pay ON biz.recall_events USING btree (site_id, assistant_id, pay_time);
CREATE UNIQUE INDEX idx_recall_events_site_assistant_member_day ON biz.recall_events USING btree (site_id, assistant_id, member_id, date_trunc('day'::text, (pay_time AT TIME ZONE 'Asia/Shanghai'::text)));
CREATE UNIQUE INDEX idx_recall_events_runtime_site_assistant_member_day ON biz.recall_events USING btree (site_id, assistant_id, member_id, runtime_mode, sandbox_instance_id, date_trunc('day'::text, (pay_time AT TIME ZONE 'Asia/Shanghai'::text)));
CREATE INDEX idx_salary_adj_assistant_month ON biz.salary_adjustments USING btree (assistant_id, salary_month);
CREATE INDEX idx_salary_adj_site_month ON biz.salary_adjustments USING btree (site_id, salary_month);

View File

@@ -1,6 +1,6 @@
-- =============================================================================
-- zqyy_app / public小程序业务表
-- 生成日期2026-04-12
-- 生成日期2026-05-02
-- 来源:测试库(通过脚本自动导出)
-- =============================================================================