fix(tradein-sql): remove duplicate CREATE INDEX from 050 (regression from PR #500)
PR #500 added 035_drop_duplicate_indexes.sql to drop listing_sources_listing_idx2 and houses_geom_idx2, but 050_search_optimization.sql re-CREATED them on every deploy (sort order: 035 DROP → 050 CREATE). End state: dupes restored. Verified on prod 2026-05-24 ~12:08 via docker exec tradein-postgres psql. Fix: remove the two CREATE INDEX statements from 050 at the source. After this PR, deploy order becomes: 035 DROPs (succeeds on existing dupes) → 050 doesn't recreate → final state matches PR #500's intent. Migration 035 retained as the durable DROP guard.
This commit is contained in:
parent
3190bbec54
commit
a10c47230b
1 changed files with 4 additions and 6 deletions
|
|
@ -77,18 +77,16 @@ CREATE INDEX IF NOT EXISTS listings_kadastr_idx
|
|||
ON listings (kadastr_num)
|
||||
WHERE kadastr_num IS NOT NULL;
|
||||
|
||||
-- 8) listing_sources (listing_id) — for source aggregation
|
||||
CREATE INDEX IF NOT EXISTS listing_sources_listing_idx2
|
||||
ON listing_sources (listing_id);
|
||||
-- 8) listing_sources (listing_id) — REMOVED in PR 7
|
||||
-- duplicate of 028_matching_tables.sql's listing_sources_listing_idx.
|
||||
|
||||
-- 9) listing_sources (listing_id, price_rub) — for price divergence detection
|
||||
CREATE INDEX IF NOT EXISTS listing_sources_price_divergence_idx2
|
||||
ON listing_sources (listing_id, price_rub)
|
||||
WHERE price_rub IS NOT NULL;
|
||||
|
||||
-- 10) houses GIST + fingerprint + kadastr (consolidated houses indexes)
|
||||
CREATE INDEX IF NOT EXISTS houses_geom_idx2
|
||||
ON houses USING GIST (geom);
|
||||
-- 10) houses fingerprint + kadastr (consolidated houses indexes)
|
||||
-- Note: houses_geom_idx2 removed in PR 7 — duplicated 009_houses.sql's houses_geom_idx.
|
||||
CREATE INDEX IF NOT EXISTS houses_fingerprint_idx2
|
||||
ON houses (address_fingerprint)
|
||||
WHERE address_fingerprint IS NOT NULL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue