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

Indicating which is the current version in history #481

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

Indicating which is the current version in history #481

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

Comments

@sqlalchemy-bot
Copy link

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
Copy link
Author

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
Copy link
Author

Changes by Michael Bayer (@zzzeek):

  • removed labels: easy
  • added labels: low priority

@sqlalchemy-bot
Copy link
Author

Changes by Michael Bayer (@zzzeek):

  • removed labels: feature
  • added labels: feature

@sqlalchemy-bot
Copy link
Author

Kazutaka Mise (@misebox) wrote:

Ok, I see.
Thank you for some advises.

@sqlalchemy-bot
Copy link
Author

@sqlalchemy-bot
Copy link
Author

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
Copy link
Author

Changes by Michael Bayer (@zzzeek):

  • changed status to closed

vvvrrooomm pushed a commit to vvvrrooomm/alembic that referenced this issue Jan 10, 2019
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: sqlalchemy#481

Change-Id: I7daa02b455aaba76c50d0e1febbdc6908693d4c9
Pull-request: https://bitbucket.org/zzzeek/alembic/pull-requests/77
vvvrrooomm pushed a commit to vvvrrooomm/alembic that referenced this issue Jan 10, 2019
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: sqlalchemy#481

Change-Id: I7daa02b455aaba76c50d0e1febbdc6908693d4c9
Pull-request: https://bitbucket.org/zzzeek/alembic/pull-requests/77
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant