feat(cantaloupe_sync): add dex_report_date, deployed, pulled_date column handling
- Add heuristic entries: dex_report_date, deployed, pulled_date - Include in COMPARE_FIELDS for diff detection - Add to approve_batch() UPDATE field_map and INSERT statement - Add v4 DB migration for three new TEXT columns - Datetime serialization already handled by parse_excel() Kanban: t_3bef3c9c
This commit is contained in:
+6
-1
@@ -330,9 +330,14 @@ 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
|
||||
# v4 migration: dex_report_date, deployed, pulled_date
|
||||
if "dex_report_date" not in asset_cols:
|
||||
conn.execute("ALTER TABLE assets ADD COLUMN dex_report_date TEXT DEFAULT NULL")
|
||||
if "deployed" not in asset_cols:
|
||||
conn.execute("ALTER TABLE assets ADD COLUMN deployed TEXT DEFAULT NULL")
|
||||
if "pulled_date" not in asset_cols:
|
||||
conn.execute("ALTER TABLE assets ADD COLUMN pulled_date TEXT DEFAULT NULL")
|
||||
# v5 migration: install_date
|
||||
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)")
|
||||
|
||||
Reference in New Issue
Block a user