Skip to content

Fix empty database bootstrap to use Alembic#4571

Open
Genmin wants to merge 1 commit intoIBM:mainfrom
Genmin:fix/alembic-bootstrap
Open

Fix empty database bootstrap to use Alembic#4571
Genmin wants to merge 1 commit intoIBM:mainfrom
Genmin:fix/alembic-bootstrap

Conversation

@Genmin
Copy link
Copy Markdown

@Genmin Genmin commented May 1, 2026

Summary

  • run alembic upgrade head for empty databases instead of creating ORM metadata directly and then stamping head
  • keep the existing baseline-stamp compatibility path for already-created schemas
  • update bootstrap unit coverage so empty databases assert migrations run and Base.metadata.create_all() is not called

Fixes #4555.

Validation

  • uv run ruff check mcpgateway/bootstrap_db.py
  • uv run pytest tests/unit/mcpgateway/test_bootstrap_db.py -q

Signed-off-by: Genmin <joey@joeyroth.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Unify schema creation: replace Base.metadata.create_all() with Alembic-only bootstrap

1 participant