Phase 2 Complete: SQL migration with SQLModel and Alembic
This commit is contained in:
+4
-3
@@ -17,10 +17,11 @@ engine = create_engine(DATABASE_URL, connect_args={"check_same_thread": False})
|
||||
|
||||
def create_db_and_tables():
|
||||
"""Create the database and tables based on the models"""
|
||||
# Import all models here to ensure they are registered with SQLModel.metadata
|
||||
# CRITICAL: Import ALL models here to ensure they are registered with SQLModel.metadata
|
||||
from app.models.auth import UserTable
|
||||
from app.models.watchlist import WatchlistItemTable
|
||||
# Add other models as they are migrated
|
||||
from app.models.watchlist import WatchlistItemTable, WatchlistSettingsTable
|
||||
from app.models.favorites import FavoriteTable
|
||||
from app.models.sonarr import SonarrMappingTable, SonarrConfigTable
|
||||
|
||||
SQLModel.metadata.create_all(engine)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user