fix(tradein): 095 drop v_data_quality before dropping sale_type_text — RED deploy (#731) #903

Merged
lekss361 merged 1 commit from fix/731-sale-type-text-view-dep into main 2026-05-31 14:02:01 +00:00

1 commit

Author SHA1 Message Date
5d6238e89a fix(tradein): 095 drop v_data_quality before dropping sale_type_text (#731)
Prod deploy 2026-05-31 13:50 failed on 095: 'cannot drop column sale_type_text
of table listings because view v_data_quality depends on it'. The view (recreated
in 094) has a CTE 'SELECT * FROM listings' which records a column-level dependency
on EVERY listings column incl sale_type_text — so the bare DROP COLUMN aborts the
whole migration (exit 1), blocking 095/096/097 from applying.

Fix: DROP VIEW v_data_quality -> DROP COLUMN sale_type_text -> recreate the view
with the identical 094 DDL (sale_type_text was never an output column, only pulled
in implicitly via SELECT *; after the drop, * no longer includes it). Verified
v_data_quality is the only object doing SELECT * FROM listings — listings_search_mv
and v_price_divergence reference explicit columns, so no other dependency blocks.

095 never applied on prod (transaction rolled back atomically, not in
_schema_migrations) → next deploy re-runs the corrected file. Editing the merged
migration in place is the correct recovery (a new 098 would not help: the runner
hits 095 first and keeps failing).

Refs #731
2026-05-31 16:57:18 +03:00