gendesign/tradein-mvp/backend/data
lekss361 09698c5124 fix(tradein): PR #469 BLOCK — h.reviews_count + DSN psycopg strip
deep-code-reviewer caught 2 critical bugs that would cause silent prod regression:

1. 050_search_optimization.sql: h.ratings_count → h.reviews_count
   (alias house_ratings_count preserved for API contract)
   houses.ratings_count does not exist; matview CREATE would abort,
   and deploy-tradein.yml swallows the error (|| echo) — Celery task
   would then fail at runtime with "relation listings_search_mv does not exist".

2. refresh_search_matview.py: strip +psycopg dialect prefix from DSN
   tradein-mvp/docker-compose.prod.yml uses postgresql+psycopg:// (SQLAlchemy
   dialect form) for DATABASE_URL. libpq accepts only postgresql:// — without
   the strip, psycopg.connect() raises OperationalError on every Celery beat tick.

Refs PR #469 review (deep-code-reviewer, 2026-05-23).
2026-05-23 16:58:14 +03:00
..
sql fix(tradein): PR #469 BLOCK — h.reviews_count + DSN psycopg strip 2026-05-23 16:58:14 +03:00