v5 migration: add dex_report_date and install_date columns to assets table

This commit is contained in:
Leo
2026-05-23 17:26:13 -04:00
parent 8d5deb735b
commit 4070214fe7
+5
View File
@@ -330,6 +330,11 @@ def init_db(conn: sqlite3.Connection):
conn.execute("ALTER TABLE assets ADD COLUMN longitude REAL DEFAULT NULL")
if "geofence_radius_meters" not in asset_cols:
conn.execute("ALTER TABLE assets ADD COLUMN geofence_radius_meters INTEGER DEFAULT 50")
# v5 migration: dex_report_date + install_date
if "dex_report_date" not in asset_cols:
conn.execute("ALTER TABLE assets ADD COLUMN dex_report_date TEXT DEFAULT NULL")
if "install_date" not in asset_cols:
conn.execute("ALTER TABLE assets ADD COLUMN install_date TEXT DEFAULT NULL")
cursor = conn.execute("PRAGMA table_info(locations)")
loc_cols = {row[1] for row in cursor.fetchall()}
if "latitude" not in loc_cols: