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

Experiment: sqlx up/down migrations #928

Open
zaychenko-sergei opened this issue Oct 28, 2024 · 0 comments
Open

Experiment: sqlx up/down migrations #928

zaychenko-sergei opened this issue Oct 28, 2024 · 0 comments
Labels
devex Development experience improvement enhancement New feature or request

Comments

@zaychenko-sergei
Copy link
Contributor

Currenty we cannot revert a database migration in case anything goes wrong.
This causes a lot of deployment stabilization efforts when a mistake was made, including manual intervention into production db.

Experiment, if up/down migrations, offered by sqlx migrate commands, can help improving this aspect:

  • sqlx migrate add -r: If true, creates a pair of up and down migration files with same version else creates a single sql file
  • sqlx migrate revert: Revert the latest migration with a down file

It's assumed that any migration would require creating a reverse-migration to achieve the desired goal.
Open question: what do we do with the existing already applied migrations.

@zaychenko-sergei zaychenko-sergei added the enhancement New feature or request label Oct 28, 2024
@zaychenko-sergei zaychenko-sergei added the devex Development experience improvement label Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devex Development experience improvement enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant