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

Indicating which is the current version in history #481

Closed
sqlalchemy-bot opened this Issue Feb 2, 2018 · 7 comments

Comments

Projects
None yet
1 participant
@sqlalchemy-bot

sqlalchemy-bot commented Feb 2, 2018

Migrated issue, originally created by Kazutaka Mise (@misebox)

Overview

Now, the history command does not tell us which the current version is. So, we have to execute the current command and look for the same version hash from output of history command.
I think it's useful if output of history command indicates which current version is.

Proposal

  • Get current version from alembic_version table.
  • Display (current) at right side of current version's hash.
  • This feature needs DB access. How about to implement as an option.
    (like alembic history --current)
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 2, 2018

Michael Bayer (@zzzeek) wrote:

history does DB access when part of the range you specify is in fact the word "current" to show how the history relates to the current tree.

note that "current" is a list of values, not a single value, as a tree can have any number of heads.

Feel free to provide a PR including a test in tests/test_command.py -> HistoryTest , call the command option --indicate-current / -i.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 2, 2018

Changes by Michael Bayer (@zzzeek):

  • removed labels: easy
  • added labels: low priority
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 2, 2018

Changes by Michael Bayer (@zzzeek):

  • removed labels: feature
  • added labels: feature
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 2, 2018

Kazutaka Mise (@misebox) wrote:

Ok, I see.
Thank you for some advises.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Mar 7, 2018

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Mar 8, 2018

Michael Bayer (@zzzeek) wrote:

Add indicate-current option into history command

Added new flag --indicate-current to the alembic history command.
When listing versions, it will include the token "(current)" to indicate
the given version is a current head in the target database. Pull request
courtesy Kazutaka Mise.

Fixes: #481

Change-Id: I7daa02b455aaba76c50d0e1febbdc6908693d4c9
Pull-request: https://bitbucket.org/zzzeek/alembic/pull-requests/77

22294ff

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Mar 8, 2018

Changes by Michael Bayer (@zzzeek):

  • changed status to closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment