Migrations fail when running alembic upgrade head especially b1546baf39b1_add_gps_columns_to_media_files which has no down revision. It attempts to add columns to media_files table which does not exist yet.
Migration is done before spinning up the fastAPI app, therefore fails.
My suggestion: Handle migrations as a separate helper, not part of the app.
Migrations fail when running
alembic upgrade headespeciallyb1546baf39b1_add_gps_columns_to_media_fileswhich has no down revision. It attempts to add columns to media_files table which does not exist yet.Migration is done before spinning up the fastAPI app, therefore fails.
My suggestion: Handle migrations as a separate helper, not part of the app.