Sqitch

sqitch-revert

Name

sqitch-revert - Revert changes to a database

Synopsis

sqitch revert [options] [<database>]
sqitch revert [options] [<database>] <change>
sqitch revert [options] [<database>] --to-change <change>
sqitch revert [options] [<database>] --modified

Description

Revert changes to the database. Starting from the current deployment state, changes will be reverted in reverse the order of application. All changes will be reverted unless a change is specified, either via --to or with no option flag, in which case changes will be reverted back to that change.

If the database has not been deployed to, or its state already matches the specified change, no changes will be made. If the change appears later in the plan than the currently-deployed state, an error will be returned, along with a suggestion to instead use sqitch-deploy.

The <database> parameter specifies the database to which to connect, and may also be specified as the --target option. It can be target name, a URI, an engine name, or plan file path.

Attention Git Users

If you’re a git user thinking this is like git revert, it’s not. sqitch revert is more like time travel. It takes your database back to the state it had just after applying the target change. It feels like magic, but it’s actually all the time you spent writing revert scripts that finally pays off. Starting from the last change currently deployed, sqitch revert runs each revert script in turn until the target change is reached and becomes the last change deployed.

Options

Configuration Variables

Sqitch

Part of the sqitch suite.