Fix database scheme and introduce automatic database migration
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user