From bf31f647e7926ec8789782325577f6b185de715f Mon Sep 17 00:00:00 2001 From: Namonay Date: Fri, 20 Feb 2026 14:50:50 +0000 Subject: [PATCH] a --- server/src/data/app.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/server/src/data/app.py b/server/src/data/app.py index c4cadea..2493857 100644 --- a/server/src/data/app.py +++ b/server/src/data/app.py @@ -12,13 +12,10 @@ cursor.execute(""" CREATE TABLE IF NOT EXISTS items ( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, - time TEXT NOT NULL + time TEXT, + noshutdown INTEGER DEFAULT 0 ) """) -try: - cursor.execute("ALTER TABLE items ADD COLUMN noshutdown INTEGER DEFAULT 0") -except sqlite3.OperationalError: - pass conn.commit() conn.close() @@ -31,7 +28,7 @@ def get_db_connection(): def mainpage(): conn = get_db_connection() cursor = conn.cursor() - cursor.execute("SELECT name, time FROM items ORDER BY name") + cursor.execute("SELECT name, time, noshutdown FROM items ORDER BY name") items = cursor.fetchall() conn.close() print(items) @@ -47,7 +44,7 @@ def submit(): if noshutdown == 0 and not time_value: return redirect(url_for("mainpage")) if noshutdown == 1: - time_value = 'None' + time_value = None conn = get_db_connection() cursor = conn.cursor() cursor.execute('SELECT 1 FROM items WHERE name = ?', (value,))