gendesign/data/sql/37_cleanup_redundant.sql
2026-04-27 13:05:36 +03:00

19 lines
1,012 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.

-- Drop tables fully superseded by domrf_realization (loaded 27.04.2026).
-- Coverage check confirmed:
-- • domrf_sold_out_by_year (6 rows, RF-only) ⊂
-- domrf_realization WHERE endpoint_type='ready_year' AND region_code=-1
-- (+ × 89 regions in same source). Values match exactly: e.g. 2027 sold 30%,
-- 2028 sold 17%, 2029 sold 9%. API data is more complete (PDF had nulls).
-- • domrf_sold_out_by_progress (6 rows, RF-only) ⊂
-- domrf_realization WHERE endpoint_type='housing' AND region_code=-1
-- (+ × 89 regions). Same buckets: not_open / до 20% / ... / 80+.
--
-- domrf_sold_out (9 rows) is KEPT — has unique attracted_funds_mln_rub column
-- not present in the API response.
--
-- Run manually:
-- docker run --rm -e PGPASSWORD=... postgres:16-alpine psql \
-- -h host.docker.internal -p 15432 -U gendesign -d gendesign \
-- -f data/sql/37_cleanup_redundant.sql
DROP TABLE IF EXISTS domrf_sold_out_by_year;
DROP TABLE IF EXISTS domrf_sold_out_by_progress;