-
Notifications
You must be signed in to change notification settings - Fork 215
Open
Labels
Description
Problem Statement
In development, it's common to add multiple changes with sqitch add
, then later decide some are unnecessary. Currently, removing undeployed changes requires:
- Editing
sqitch.plan
manually. - Deleting the corresponding deploy, revert, and verify scripts.
- (If applicable) Removing from version control.
This process could be streamlined with a sqitch reset
command, modeled after git reset
.
Proposed Behavior
-
sqitch reset
(without arguments)- Resets to the last deployed change.
- Removes all undeployed changes from
sqitch.plan
. - Deletes their SQL files.
-
sqitch reset <change>
- Resets to the specified
<change>
. - Tries to remove all changes after
<change>
. - Checks only the development database to determine if any of those changes are deployed.
- Blocks removal if any of those changes are already deployed, displaying an error:
"Change
<next_change>
is deployed on<target>
. Runsqitch revert <target> -to <previous_change>
first."
- Resets to the specified
This ensures that changes aren’t removed while still deployed, preventing inconsistencies.
Future Enhancements
Options like --soft
(keep SQL files) and --hard
(also remove from VCS) could be considered later.
Would this be useful for others? Feedback is welcome!