refactor: move db_maintenance table creation to the correct migration step

- Reintroduced the creation of the db_maintenance table in the appropriate section of the database setup process.
- Ensured that the table is created after the version migration to maintain database integrity.
This commit is contained in:
g0ldyy
2025-12-10 18:20:26 +01:00
parent d404736b3c
commit 61ab23472b
+9 -8
View File
@@ -30,14 +30,6 @@ async def setup_database():
"""
)
await database.execute(
"""
CREATE TABLE IF NOT EXISTS db_maintenance (
id INTEGER PRIMARY KEY CHECK (id = 1),
last_startup_cleanup REAL
)
"""
)
current_version = await database.fetch_val(
"""
@@ -86,6 +78,15 @@ async def setup_database():
"COMET", f"Database: Migration to version {DATABASE_VERSION} completed"
)
await database.execute(
"""
CREATE TABLE IF NOT EXISTS db_maintenance (
id INTEGER PRIMARY KEY CHECK (id = 1),
last_startup_cleanup REAL
)
"""
)
await database.execute(
"""
CREATE TABLE IF NOT EXISTS ongoing_searches (