From bd887ce8d5a40367c661c89a8d0cfdcf37cb3b87 Mon Sep 17 00:00:00 2001 From: Sam Chau Date: Wed, 8 Jan 2025 20:33:48 +1030 Subject: [PATCH] feat: add import_task_id column to settings table for task tracking --- backend/app/db.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/app/db.py b/backend/app/db.py index cbc8be3..23a2aa2 100644 --- a/backend/app/db.py +++ b/backend/app/db.py @@ -38,6 +38,7 @@ def init_db(): sync_method TEXT DEFAULT 'manual', sync_interval INTEGER DEFAULT 0, import_as_unique BOOLEAN DEFAULT 0, + import_task_id INTEGER DEFAULT NULL, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ) @@ -80,6 +81,7 @@ def init_db(): ) ''') + # Insert or ignore example conn.execute(''' INSERT OR IGNORE INTO settings (key, value, updated_at) VALUES ('auto_pull_enabled', 0, CURRENT_TIMESTAMP) @@ -95,7 +97,6 @@ def init_db(): updated_at = CURRENT_TIMESTAMP ''', (str(bool(profilarr_pat)).lower(), str( bool(profilarr_pat)).lower())) - conn.commit() secret_key = conn.execute( @@ -117,6 +118,7 @@ def init_db(): created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ) ''') + conn.execute(''' CREATE TABLE IF NOT EXISTS failed_attempts ( id INTEGER PRIMARY KEY AUTOINCREMENT,