gendesign/tradein-mvp/scripts/README.md
lekss361 c0a0bfa413
Some checks failed
Deploy Trade-In / changes (push) Successful in 5s
Deploy Trade-In / build-backend (push) Has been skipped
Deploy Trade-In / build-frontend (push) Has been skipped
Deploy Trade-In / deploy (push) Has been cancelled
feat(tradein): Phase 1.3 backfill scripts — fingerprints + house/listing_sources (#475)
2026-05-23 14:29:39 +00:00

27 lines
1 KiB
Markdown

# tradein-mvp scripts -- backfill
One-shot manual operator scripts. **NOT auto-applied by deploy.yml** (which only runs `tradein-mvp/backend/data/sql/NN_*.sql`).
## Order
Run in numbered sequence after PR #470 (matching module) merged:
```bash
cd tradein-mvp/backend
export DATABASE_URL="postgresql+psycopg://user:pass@host:5432/tradein"
# 001 -- backfill houses.address_fingerprint (Python, idempotent)
uv run python ../scripts/backfill_001_address_fingerprints.py
# 002 -- backfill house_sources link rows (SQL, idempotent)
psql "${DATABASE_URL/postgresql+psycopg/postgresql}" -f ../scripts/backfill_002_house_sources.sql
# 003 -- backfill listing_sources link rows (SQL, idempotent)
psql "${DATABASE_URL/postgresql+psycopg/postgresql}" -f ../scripts/backfill_003_listing_sources.sql
```
All scripts idempotent -- re-running is safe (ON CONFLICT DO NOTHING on the SQL; row-level UPDATE WHERE NULL on the Python).
## Other scripts
- `upload-cian-cookies.sh` -- one-shot Cian session cookie upload (see inline docs)