Files
ewoooc/migrations/042_add_browse_diagnostics_to_match_attempts.sql
OoO 0cea70890a
All checks were successful
CD Pipeline / deploy (push) Successful in 1m21s
導入 browse.sh 比價診斷計畫
2026-05-21 18:40:49 +08:00

24 lines
1.1 KiB
SQL
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.
-- =============================================================================
-- 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 $$;