]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commit
Add "--check-heads" option to "current" command
authorStefan Scherfke <stefan@sofa-rockers.org>
Tue, 28 Oct 2025 12:06:31 +0000 (08:06 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 28 Oct 2025 12:48:02 +0000 (08:48 -0400)
commit21992137974999e60870fb021829576dca5eb0a4
tree0909b98af6207406fe2f615782776c5a7f4f4523
parent709c0be4a2dca3ceef04aae432417fb76f2930c7
Add "--check-heads" option to "current" command

Added :paramref:`.command.current.check_heads` parameter to
:func:`.command.current` command, available from the command line via the
``--check-heads`` option to ``alembic current``.  This tests if all head
revisions are applied to the database and raises :class:`.DatabaseNotAtHead`
(or from the command line, exits with a non-zero exit code) if this is not
the case.  The parameter operates equvialently to the cookbook recipe
:ref:`cookbook_check_heads`. Pull request courtesy Stefan Scherfke.

Fixes: #1705
Closes: #1739
Pull-request: https://github.com/sqlalchemy/alembic/pull/1739
Pull-request-sha: 955f9b7ff6216c3c2940597a652cce538a6e0f29

Change-Id: I1173217ff6a4927226ec9e7b8c7ef67c6431d728
alembic/command.py
alembic/config.py
alembic/util/__init__.py
alembic/util/exc.py
docs/build/api/exceptions.rst [new file with mode: 0644]
docs/build/api/index.rst
docs/build/cookbook.rst
docs/build/unreleased/1705.rst [new file with mode: 0644]
tests/test_command.py