fix: prevent concurrent migrations in multi-worker setup
Add migration version check before running alembic upgrade to prevent multiple uvicorn workers from running migrations simultaneously. - Check current vs head revision before running migrations - Skip migration if already at latest version - Log current and head revision for debugging
This commit is contained in:
@@ -11,7 +11,7 @@ from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '0003'
|
||||
revision: str = '0003_user_configs'
|
||||
down_revision: Union[str, None] = '0002_refresh_tokens'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
Reference in New Issue
Block a user