mirror of
https://github.com/g0ldyy/comet.git
synced 2026-01-12 01:16:12 +01:00
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:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user