diff --git a/app/db.py b/app/db.py index 76fc2c0..75674b4 100644 --- a/app/db.py +++ b/app/db.py @@ -95,6 +95,13 @@ def init_db(conn): conn.execute('ALTER TABLE listings ADD COLUMN seller_type TEXT') if 'extras' not in cols: conn.execute('ALTER TABLE listings ADD COLUMN extras TEXT') + # B1 (photo experience v2): gallery URLs + swipe-time photo index. + if 'imgs' not in cols: + conn.execute('ALTER TABLE listings ADD COLUMN imgs TEXT') + sw_cols = {r['name'] for r in conn.execute( + "PRAGMA table_info('swipes')")} + if 'last_photo_idx' not in sw_cols: + conn.execute('ALTER TABLE swipes ADD COLUMN last_photo_idx INTEGER') # P3 tables (idempotent on every call) conn.executescript(P3_SCHEMA) # P3 event seeding: one round-1 event per existing swipe, copied