FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

docs: add complete alembic integration example by pctablet505 · Pull Request #1741 · ormar-orm/ormar · GitHub

docs: add complete alembic integration example - #1741

Open
pctablet505 wants to merge 2 commits into
ormar-orm:masterfrom
pctablet505:fix-1400-alembic-docs-example
Open

docs: add complete alembic integration example#1741
pctablet505 wants to merge 2 commits into
ormar-orm:masterfrom
pctablet505:fix-1400-alembic-docs-example

Conversation

pctablet505 commented Jul 15, 2026
edited
Loading

Copy link
Copy Markdown

Fixes #1400.

The current Alembic docs skip too many steps for anyone new to ormar — imports, where metadata comes from, and how to handle models split across apps. I added a complete, working example based on the FastAPI-template reference linked in the issue.

It covers a single-file layout, a multi-app layout, a minimal alembic.ini, and wiring the shared metadata into alembic/env.py. I ran alembic revision --autogenerate and alembic upgrade head against both layouts and built the docs with mkdocs build to make sure everything works.

codspeed-hq Bot commented Jul 16, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 98 untouched benchmarks


Comparing pctablet505:fix-1400-alembic-docs-example (db9168d) with master (e910772)1

Footnotes

  1. No successful run was found on master (710cdbb) during the generation of this report, so e910772 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

pctablet505 marked this pull request as ready for review July 17, 2026 12:47
Expand the migrations/Alembic docs with a working, end-to-end example:

- Explain where the SQLAlchemy MetaData comes from in ormar and how to
  expose it for Alembic.
- Add a sample project layout with my_project/models.py, alembic.ini,
  and alembic/env.py.
- Show how to handle models split across multiple apps/packages by
  importing all models before Alembic reads the metadata.
- Keep the existing compare_type and include_object tips intact.

Fixes ormar-orm#1400
pctablet505 force-pushed the fix-1400-alembic-docs-example branch from eecaa52 to 393859e Compare August 21, 2026 15:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

A *working* alembic example in the docs

1 participant


Back | FazBrowse Home | New Git URL