snipe/app/db/migrations
pyr0ball d9660093b1 fix(tasks): address code review — cloud DB path, migration number, connection handling, enqueue site
- Rename 002_background_tasks.sql → 007_background_tasks.sql to avoid
  collision with existing 002_add_listing_format.sql migration
- Add CREATE UNIQUE INDEX on trust_scores(listing_id) in same migration
  so save_trust_scores() can use ON CONFLICT upsert semantics
- Add Store.save_trust_scores() — upserts scores keyed by listing_id;
  preserves photo_analysis_json so runner writes are never clobbered
- runner.py: replace raw sqlite3.connect() with get_connection() throughout
  (timeout=30 + WAL mode); fix connection leak in insert_task via try/finally
- _run_trust_photo_analysis: read 'user_db' from params to write results to
  the correct per-user DB in cloud mode (was silently writing to wrong DB)
- main.py lifespan: use _shared_db_path() in cloud mode so background_tasks
  queue lives in shared DB, not _LOCAL_SNIPE_DB
- Add _enqueue_vision_tasks() and call it after score_batch() — this is the
  missing enqueue call site; gated by features.photo_analysis (Paid tier)
- Test fixture: add missing 'stage' column to background_tasks schema
2026-03-31 17:00:01 -07:00
..
001_init.sql feat: add data models, migrations, and store 2026-03-25 13:08:55 -07:00
002_add_listing_format.sql feat(snipe): auction support + easter eggs (Konami, The Steal, de-emphasis) 2026-03-25 14:27:02 -07:00
002_background_tasks.sql feat(tasks): add vision task scheduler for trust_photo_analysis 2026-03-31 09:27:55 -07:00
003_nullable_account_age.sql fix: account_age_days=None for scraper tier, stop false new_account flags 2026-03-25 20:36:43 -07:00
004_staging_tracking.sql feat(snipe): eBay trust scoring MVP — search, filters, enrichment, comps 2026-03-26 23:37:09 -07:00
005_listing_category.sql feat(snipe): eBay trust scoring MVP — search, filters, enrichment, comps 2026-03-26 23:37:09 -07:00
007_background_tasks.sql fix(tasks): address code review — cloud DB path, migration number, connection handling, enqueue site 2026-03-31 17:00:01 -07:00