Fix database scheme and introduce automatic database migration

This commit is contained in:
2026-01-19 23:22:16 +01:00
parent 6fb38a795c
commit cc40c33dc9
5 changed files with 114 additions and 42 deletions

View File

@@ -7,7 +7,7 @@ import argon2
from .dns import DNSService
from .email import EmailService
from .models import init_database
from .models import create_tables, init_database
from .ratelimit import RateLimiter
@@ -35,8 +35,9 @@ class Application:
self.rate_limiter = None
def init_database(self):
"""Initialize database connection."""
"""Initialize database connection and run migrations."""
init_database(self.config)
create_tables()
logging.debug("Database initialized")
def init_dns(self):