8000 Add `stamp`, `stamp-to` commands by bitfehler · Pull Request #954 · pressly/goose · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add stamp, stamp-to commands #954

8000
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

bitfehler
Copy link

These commands modify the version table without actually running any migrations. The command names are taken from alembic, but other frameworks also support this under different names (repair, force, ...), see #938.

The stamp command simply sets the database version to that of the latest available migration, where as the stamp-to command allows to specify a version (including 0). Stamping can both increase and decrease the database version.

Fixes: #938

These commands modify the version table without actually running any
migrations. The command names are taken from alembic [1], but other
frameworks also support this under different names (repair, force, ...),
see pressly#938.

The `stamp` command simply sets the database version to that of the
latest available migration, where as the `stamp-to` command allows to
specify a version (including 0). Stamping can both increase and decrease
the database version.

[1]: https://alembic.sqlalchemy.org/en/latest/api/commands.html#alembic.command.stamp

Fixes: pressly#938
@bitfehler
Copy link
Author

Hi there, thank you for your work on goose! We really like it and are in the process of migrating over from alembic, hence the choice of command naming. However, I'd be totally open to give these commands any other name 🙂 we'd just be super happy to see this functionality added to goose!

I have tested the functionality with a simple project, and it handled all of the cases I could think of. However, this was my first time looking at goose internals, so I may have missed a bunch of stuff. If you'd be up for including this functionality at all I am happy to spend time refining this PR to your liking!

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Allow "mark as applied"
1 participant
0