Add support for STEP in clickhouse rake tasks
What does this MR do and why?
This MR adds support for specifying the STEP
environment variable, in the same way as the equivalent Rails rake tasks. The immediate consequence is that bin/rake clickhouse:rollback
will no longer roll back all migrations, since STEP
defaults to 1 for rollbacks.
Part of #428124 (closed)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Ensure all the migrations are up:
rake gitlab:clickhouse:migrate
-
Migrate down to a specific version:
rake gitlab:clickhouse:rollback VERSION=20230724064918
this should roll back 3 migrations:
-
Perform a rollback:
rake gitlab:clickhouse:rollback
this should roll back the last active migration:
-
Migrate down a few steps:
rake gitlab:clickhouse:rollback STEP=2
this should roll back
20230724064832
and20230719101806
:
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.