From 7a61f17138d61761db5eccafe5bfb20096d57a4c Mon Sep 17 00:00:00 2001 From: projectdx Date: Tue, 6 Jan 2026 20:59:56 +0900 Subject: [PATCH] Fix: Check table existence before migration --- info.yaml | 2 +- model.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/info.yaml b/info.yaml index f35c39d..9cb0525 100644 --- a/info.yaml +++ b/info.yaml @@ -1,6 +1,6 @@ name: GDM package_name: gommi_downloader_manager -version: '0.1.14' +version: '0.1.15' description: FlaskFarm 범용 다운로더 큐 - YouTube, 애니24, 링크애니, Anilife 지원 developer: projectdx home: https://gitea.yommi.duckdns.org/projectdx/gommi_downloader_manager diff --git a/model.py b/model.py index 6f5d361..12dce52 100644 --- a/model.py +++ b/model.py @@ -69,6 +69,12 @@ class ModelDownloadItem(ModelBase): conn = sqlite3.connect(db_file) cursor = conn.cursor() + # 테이블 존재 여부 확인 + cursor.execute(f"SELECT count(*) FROM sqlite_master WHERE type='table' AND name='{cls.__tablename__}'") + if cursor.fetchone()[0] == 0: + conn.close() + return + # meta 컬럼 확인 cursor.execute(f"PRAGMA table_info({cls.__tablename__})") columns = [info[1] for info in cursor.fetchall()]