Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify what autogenerate compares #1570

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions docs/build/autogenerate.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Auto Generating Migrations
===========================

Alembic can view the status of the database and compare against the table metadata
in the application, generating the "obvious" migrations based on a comparison. This
is achieved using the ``--autogenerate`` option to the ``alembic revision`` command,
which places so-called *candidate* migrations into our new migrations file. We
Alembic can view the status of the database (pointed to by ``sqlalchemy.url`` in
your ``alemic.ini`` file using the *current* schema) and compare against the
table metadata in the application (your ORM which defines the *proposed* schema),
generating the "obvious" migrations based on a comparison. This is achieved
using the ``--autogenerate`` option to the ``alembic revision`` command, which
places so-called *candidate* migrations into our new migrations file. We
review and modify these by hand as needed, then proceed normally.

To use autogenerate, we first need to modify our ``env.py`` so that it gets access
Expand Down