gendesign/tradein-mvp/backend/data/sql/095_dead_schema.sql
bot-backend e6e5214fa5 refactor(tradein): drop dead schema — sale_type_text column + audit_log (#731)
Verified-safe subset of TradeinDb_Audit_May30 (analyst-pruned).
- remove sale_type_text refs from yandex_detail.py (model field + parse + ctor)
  and conflict_resolution.py priority map (column 100% NULL, code-only)
- migration 095: ALTER listings DROP COLUMN sale_type_text; DROP TABLE audit_log
  (0 rows, 0 refs, no triggers). BEGIN/COMMIT + IF EXISTS, idempotent.

Refs #731
2026-05-31 15:57:37 +03:00

24 lines
1.1 KiB
PL/PgSQL
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.

-- 095_dead_schema.sql
-- Purpose: Удаление мёртвой схемы (верифицированный безопасный подмножество аудита TradeinDb_Audit_May30).
--
-- Контекст (Issue #731):
-- sale_type_text: столбец 100% NULL в listings, code refs удалены в том же PR.
-- audit_log: 0 строк, 0 python refs, триггеры не зависят (верифицировано).
--
-- Idempotency:
-- ALTER TABLE ... DROP COLUMN IF EXISTS — безопасен при повторном запуске.
-- DROP TABLE IF EXISTS — безопасен при повторном запуске.
--
-- Явно НЕ удаляем: houses_price_dynamics, agents, sellers, estimate_photos,
-- house_reviews, listings_snapshots.
BEGIN;
-- #731: drop dead schema (verified-safe subset of TradeinDb_Audit_May30)
-- sale_type_text: 100% NULL in listings, code refs removed in same PR
ALTER TABLE IF EXISTS listings DROP COLUMN IF EXISTS sale_type_text;
-- audit_log: 0 rows, 0 python refs, no triggers depend on it (verified)
DROP TABLE IF EXISTS audit_log;
COMMIT;