From f4a5aa4361a83652ab3f4a1c7376e9d34de46d93 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 10 Jul 2026 23:45:59 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20sql=20migration=20135=20=E2=80=94=20demo?= =?UTF-8?q?te=2060k=20auto=5Fapproved=20without=20fx.standard=5Fname?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/135-equivalences-quality-cleanup.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 sql/135-equivalences-quality-cleanup.sql diff --git a/sql/135-equivalences-quality-cleanup.sql b/sql/135-equivalences-quality-cleanup.sql new file mode 100644 index 0000000..da3e6d6 --- /dev/null +++ b/sql/135-equivalences-quality-cleanup.sql @@ -0,0 +1,14 @@ +-- Migration 135: Equivalence quality cleanup +-- Demotes auto_approved rows that no longer meet quality gates: +-- 1. FX product has no standard_name → can't verify match quality +-- Applied 2026-07-11 after adding standard_name gate to catalog-reconcile. + +UPDATE transceiver_equivalences e +SET status = 'pending', updated_at = NOW() +FROM transceivers fx +WHERE e.flexoptix_id = fx.id + AND e.status = 'auto_approved' + AND fx.standard_name IS NULL; + +-- Result: 60,278 demoted from auto_approved → pending +-- Remaining auto_approved: 20,838 (all with standard_name)