Files
shanxia2.0/docs/sql/migrations/2026-09-05-fix-pl-db-link-orphaned-stop.sql
T

18 lines
796 B
SQL
Raw 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.
-- 备忘:修复 PO20260904024 悬空地磅 link(stop/product 软删重建后未改挂)
-- 生产确认后执行;亦可使用 scripts/fix_pl_transport_db_link_stop_ids.py --plan-no PO20260904024 --apply
--
-- 背景:
-- link 4AAE759627054CAAB6B5F36D4888CBA4 仍指向软删送货段/产品,
-- 详情按当前段 id 过滤 →「暂无关联地磅单」。
-- 目标:
-- stop_id 1D4CB037… → 2036E1B2CEC54509ABC2B22DAA5786F3
-- plan_product_id DA6B3548… → 537B42A6B7E54D7CBD4C90DC73B185E7
UPDATE pl_transport_db_link
SET stop_id = '2036E1B2CEC54509ABC2B22DAA5786F3',
plan_product_id = '537B42A6B7E54D7CBD4C90DC73B185E7',
update_time = NOW()
WHERE id = '4AAE759627054CAAB6B5F36D4888CBA4'
AND plan_id = '551307353C99489786756A3F26C49020'
AND del_flag = 0;