gendesign/tradein-mvp/backend/data/sql/095_dead_schema.sql
bot-backend fa2bd20ac6
Some checks failed
Deploy Trade-In / build-backend (push) Blocked by required conditions
Deploy Trade-In / deploy (push) Blocked by required conditions
Deploy Trade-In / changes (push) Successful in 4s
Deploy Trade-In / build-frontend (push) Has been skipped
Deploy Trade-In / test (push) Has been cancelled
refactor(tradein): drop dead schema — sale_type_text column + audit_log (#731) (#893)
Co-authored-by: bot-backend <bot-backend@gendsgn.local>
Co-committed-by: bot-backend <bot-backend@gendsgn.local>
2026-05-31 13:13:43 +00: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;