feat: migrate persistence from JSON to SQLModel (Phase 1)
- Integrated SQLModel with SQLite for robust data persistence - Refactored UserManager and WatchlistManager to use SQL queries - Migrated models to SQLModel with relationships and primary keys - Updated test suite with in-memory database isolation - Removed deprecated JSON storage files
This commit is contained in:
@@ -52,6 +52,11 @@ episode_checker.set_download_manager(download_manager)
|
||||
@app.on_event("startup")
|
||||
async def startup_event():
|
||||
"""Initialize services on application startup"""
|
||||
# Create database tables if they don't exist
|
||||
from app.database import create_db_and_tables
|
||||
create_db_and_tables()
|
||||
logger.info("Database tables initialized")
|
||||
|
||||
from app.sonarr_handler import get_sonarr_handler
|
||||
|
||||
sonarr_handler = get_sonarr_handler()
|
||||
|
||||
Reference in New Issue
Block a user