start: rewrite the database layer using a freaking ORM

+ start ditching in-mem stores
+ move main db table to a new name
+ experiments!
This commit is contained in:
cwilvx
2024-06-24 00:26:47 +03:00
parent c3472a865a
commit c42ec4dcde
27 changed files with 1399 additions and 397 deletions
+6 -4
View File
@@ -5,6 +5,7 @@ Reads and applies the latest database migrations.
"""
import inspect
import sys
from types import ModuleType
from app.db.sqlite.migrations import MigrationManager
from app.logger import log
@@ -55,11 +56,12 @@ def apply_migrations():
to_apply = all_migrations[index:]
for migration in to_apply:
try:
# try:
migration.migrate()
log.info("Applied migration: %s", migration.__name__)
except Exception as e:
log.error("Failed to run migration: %s", migration.__name__)
log.error(e)
# except Exception as e:
# log.error("Failed to run migration: %s", migration.__name__)
# log.error(e)
# sys.exit(0)
MigrationManager.set_index(len(all_migrations))