v5 migration: add dex_report_date and install_date columns to assets table
This commit is contained in:
@@ -330,6 +330,11 @@ def init_db(conn: sqlite3.Connection):
|
|||||||
conn.execute("ALTER TABLE assets ADD COLUMN longitude REAL DEFAULT NULL")
|
conn.execute("ALTER TABLE assets ADD COLUMN longitude REAL DEFAULT NULL")
|
||||||
if "geofence_radius_meters" not in asset_cols:
|
if "geofence_radius_meters" not in asset_cols:
|
||||||
conn.execute("ALTER TABLE assets ADD COLUMN geofence_radius_meters INTEGER DEFAULT 50")
|
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)")
|
cursor = conn.execute("PRAGMA table_info(locations)")
|
||||||
loc_cols = {row[1] for row in cursor.fetchall()}
|
loc_cols = {row[1] for row in cursor.fetchall()}
|
||||||
if "latitude" not in loc_cols:
|
if "latitude" not in loc_cols:
|
||||||
|
|||||||
Reference in New Issue
Block a user