From 3b646353395a0bbd5a69f37ef732791f475e8ce3 Mon Sep 17 00:00:00 2001 From: Torres Date: Wed, 11 Nov 2026 00:02:42 -0400 Subject: [PATCH] =?UTF-8?q?b1:=20db=20=E2=80=94=20guarded=20migrations:=20?= =?UTF-8?q?listings.imgs=20(gallery=20JSON)=20+=20swipes.last=5Fphoto=5Fid?= =?UTF-8?q?x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/db.py | 7 +++++++ 1 file changed, 7 insertions(+) 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