diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-11-23 15:23:52 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-11-23 15:23:52 -0500 |
commit | 2639f8f5f85294a84414a5adeb8bcce601e8977a (patch) | |
tree | e1a37dbede088ce44759d7adf37abb4e9280d6c9 /docs/build/tutorial.rst | |
parent | 6b0b54b35bb4039a59d3ac53c58b998800072726 (diff) | |
download | alembic-2639f8f5f85294a84414a5adeb8bcce601e8977a.tar.gz |
- Relative revision identifiers as used with ``alembic upgrade``,
``alembic downgrade`` and ``alembic history`` can be combined with
specific revisions as well, e.g. ``alembic upgrade ae10+3``, to produce
a migration target relative to the given exact version.
Diffstat (limited to 'docs/build/tutorial.rst')
-rw-r--r-- | docs/build/tutorial.rst | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/docs/build/tutorial.rst b/docs/build/tutorial.rst index 5eda91d..de2a93e 100644 --- a/docs/build/tutorial.rst +++ b/docs/build/tutorial.rst @@ -405,6 +405,20 @@ Running again to ``head``:: We've now added the ``last_transaction_date`` column to the database. +Partial Revision Identifiers +============================= + +Any time we need to refer to a revision number explicitly, we have the option +to use a partial number. As long as this number uniquely identifies the +version, it may be used in any command in any place that version numbers +are accepted:: + + $ alembic upgrade ae1 + +Above, we use ``ae1`` to refer to revision ``ae1027a6acf``. +Alembic will stop and let you know if more than one version starts with +that prefix. + .. relative_migrations: Relative Migration Identifiers @@ -419,19 +433,13 @@ Negative values are accepted for downgrades:: $ alembic downgrade -1 -Partial Revision Identifiers -============================= - -Any time we need to refer to a revision number explicitly, we have the option -to use a partial number. As long as this number uniquely identifies the -version, it may be used in any command in any place that version numbers -are accepted:: +Relative identifiers may also be in terms of a specific revision. For example, +to upgrade to revision ``ae1027a6acf`` plus two additional steps:: - $ alembic upgrade ae1 + $ alembic upgrade ae10+2 -Above, we use ``ae1`` to refer to revision ``ae1027a6acf``. -Alembic will stop and let you know if more than one version starts with -that prefix. +.. versionadded:: 0.7.0 Support for relative migrations in terms of a specific + revision. Getting Information =================== |