fix: sql migration 135 — demote 60k auto_approved without fx.standard_name

This commit is contained in:
root 2026-07-10 23:45:59 +00:00
parent 970a7ad9e8
commit f4a5aa4361

View File

@ -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)