This commit is contained in:
23
migrations/042_add_browse_diagnostics_to_match_attempts.sql
Normal file
23
migrations/042_add_browse_diagnostics_to_match_attempts.sql
Normal file
@@ -0,0 +1,23 @@
|
||||
-- =============================================================================
|
||||
-- Migration 042: PChome browse.sh 診斷計畫欄位
|
||||
-- MOMO PRO — Price comparison fallback observability
|
||||
-- 2026-05-21 台北
|
||||
-- =============================================================================
|
||||
-- 說明:
|
||||
-- competitor_match_attempts 補存 browse.sh 診斷計畫 JSON。
|
||||
-- 正式價格爬蟲仍維持 API-first;此欄位只保存低信心、無結果、
|
||||
-- 單位價覆核或外部爬蟲錯誤時的 read-only probe plan,供人工或
|
||||
-- opt-in 執行 `browse get/open` 做 selector / XHR / 商品頁取證。
|
||||
-- =============================================================================
|
||||
|
||||
ALTER TABLE IF EXISTS competitor_match_attempts
|
||||
ADD COLUMN IF NOT EXISTS browse_diagnostic_json JSONB;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_comp_match_attempts_browse_diag_time
|
||||
ON competitor_match_attempts (attempted_at DESC)
|
||||
WHERE browse_diagnostic_json IS NOT NULL;
|
||||
|
||||
DO $$
|
||||
BEGIN
|
||||
RAISE NOTICE '✅ Migration 042 完成 — PChome browse.sh 診斷計畫欄位已補齊';
|
||||
END $$;
|
||||
Reference in New Issue
Block a user