sqitch-rebase(3pm)

πŸŽ€ NAME πŸŽ€

sqitch-rebase β€” revert and redeploy database changes, bestie πŸ’–

(yes this is the sqitch-rebase(3pm) page, straight outta User Contributed Perl Documentation, hiii ✨)


✨ SYNOPSIS ✨

sqitch rebase [options] [<database>]
sqitch rebase [options] [<database>] --onto-change <change>
sqitch rebase [options] [<database>] --onto-change <change> --upto-change <change>
sqitch rebase [options] [<database>] <change>
sqitch rebase [options] [<database>] <change> --upto-change <change>
sqitch rebase [options] [<database>] <change> <change>
sqitch rebase [options] [<database>] --modified
sqitch rebase [options] [<database>] --modified --upto-change <change>

🌸 DESCRIPTION 🌸

Okay so real talk: this reverts and redeploys your changes to the database. It's lowkey just a shortcut for running sqitch revert and sqitch deploy one right after the other. Iconic combo, no notes. πŸ’…

More specifically? Starting from wherever your deployment state is right now, changes get reverted in reverse the order of application. All changes get reverted unless you name a change β€” either via --onto or just by passing it with no option flag β€” and in that case things get reverted back to that change. And if literally nothing needs reverting, Sqitch emits a message explaining why and reverts nothing. Respect. πŸ™ˆ

Once the revert is done, changes get deployed starting from the deployed state through the rest of the deployment plan. They run all the way to the latest change in the plan, unless you specify a change β€” either via --upto or again with no option flag β€” in which case changes get deployed up-to and including that change.

If the database hasn't been deployed to at all, or its state already matches the change you named, no reverts run. And if at that point the database is already up-to-date, no deploys run either. We love a no-op that tells you it's a no-op. ⭐

The <database> parameter tells Sqitch which database to connect to, and you can also hand that over as the --target option instead. It can be a target name, a URI, an engine name, or a plan file path. Choose your fighter. πŸ¦‹


πŸ’… OPTIONS πŸ’…

  • -t, --target β€” the target database you're connecting to. Can be either a URI or the name of a target from your configuration.
  • --onto-change, --onto β€” specify the reversion change. Defaults to reverting all the changes. Peep sqitchchanges for all the ways you can specify a change. (yes sqitchchanges, go look, it's giving encyclopedic)
  • --upto-change, --upto β€” specify the deployment change. Defaults to the last point in the plan. Again, sqitchchanges has the full menu of ways to specify a change.
  • -m, --modified β€” finds the change to revert onto based on modifications to deploy scripts. It reverts the change prior to the earliest change with a revised deploy script. Handy for quick rebases during iterative development cycles. Your little dev-loop cheat code. πŸ”₯
  • --mode β€” specify the reversion mode to use in case of deploy failure. Possible values are:
    • all β€” in the event of failure, revert all deployed changes, back to --onto-change. This is the default.
    • tag β€” in the event of failure, revert all deployed changes to the last successfully-applied tag. If no tags were applied, all changes will be reverted to --onto-change.
    • change β€” in the event of failure, no changes will be reverted. This is on the assumption that a change is atomic, and thus may may be deployed again.
  • --verify β€” verify each change by running its verify script, if there is one, immediate after deploying it. If a verify test fails, the deploy is considered to have failed and the appropriate reversion gets carried out, depending on the value of --mode. Failing a vibe check = consequences. 😭
  • --no-verify β€” don't verify each change. This is the default.
  • -s, --set β€” set a variable name and value for use by the database engine client, if it supports variables. The format must be name=value, e.g., --set defuser='Homer Simpson'. Overrides any values loaded from configuration Variables.
  • -e, --set-deploy β€” set a variable name and value for use by the database engine client when deploying, if it supports variables. The format must be name=value, e.g., --set defuser='Homer Simpson'. Overrides any values from --set or values loaded from configuration Variables.
  • -r, --set-revert β€” sets a variable name to be used by the database engine client during when reverting, if it supports variables. The format must be name=value, e.g., --set defuser='Homer Simpson'. Overrides any values from --set or values loaded from configuration Variables.
  • --log-only β€” log the changes as if they were deployed and reverted, but without actually running the deploy and revert scripts. Manifesting without the mess ✨
  • --lock-timeout β€” set the number of seconds for Sqitch to wait to get an exclusive advisory lock on the target database, for engines that support such a lock. This lock prevents other instances of Sqitch from working on the target at the same time, but prevents no other database activity. Defaults to 60. Example:
sqitch rebase --lock-timeout 600
  • -y β€” disable the prompt that normally asks whether or not to execute the revert. Autopilot mode, activated. 🫢
  • --registry β€” the name of the Sqitch registry schema or database in which sqitch stores its own data. Like so:
sqitch rebase --registry registry
  • --db-client, --client β€” path to the command-line client for the database engine. Defaults to a client in the current path named appropriately for the database engine. For example:
sqitch rebase --client /usr/local/pgsql/bin/psql
  • -d, --db-name β€” name of the database. In general, targets and URIs are preferred, but this option can be used to override the database name in a target. e.g.
sqitch rebase --db-name widgets
sqitch rebase -d bricolage
  • -u, --db-user, --db-username β€” user name to use when connecting to the database. Does not apply to all engines. In general, targets and URIs are preferred, but this option can be used to override the user name in a target. Examples bestie:
sqitch rebase --db-username root
sqitch rebase --db-user postgres
sqitch rebase -u Mom
  • -h, --db-host β€” host name to use when connecting to the database. Does not apply to all engines. In general, targets and URIs are preferred, but this option can be used to override the host name in a target. Like:
sqitch rebase --db-host db.example.com
sqitch rebase -h appdb.example.net
  • -p, --db-port β€” port number to connect to. Does not apply to all engines. In general, targets and URIs are preferred, but this option can be used to override the port in a target. Example:
sqitch rebase --db-port 7654
sqitch rebase -p 5431
  • --plan-file, -f β€” path to the deployment plan file. Overrides target, engine, and core configuration values. Defaults to $top_dir/sqitch.plan.
sqitch rebase --plan-file my.plan

🌈 CONFIGURATION VARIABLES 🌈

May be overridden by --set, --set-deploy, --set-revert, or target and engine configuration. Variables are merged in the following priority order:

  • --set-revert β€” used only while reverting changes.
  • --set-deploy β€” used only while deploying changes.
  • --set β€” used while reverting and deploying changes.
  • target.$target.variables β€” used while reverting and deploying changes.
  • engine.$engine.variables β€” used while reverting and deploying changes.
  • revert.variables β€” used only while reverting changes.
  • deploy.variables β€” used while reverting and deploying changes.
  • core.variables β€” used while reverting and deploying changes.
  • rebase.verify, deploy.verify β€” boolean indicating whether or not to verify each change after deploying it.
  • rebase.mode, deploy.mode β€” deploy mode. The supported values are the same as for the --mode option.
  • rebase.no_prompt, revert.no_prompt β€” a boolean value indicating whether or not to disable the prompt before executing the revert. The rebase.no_prompt variable takes precedence over revert.no_prompt, and both may of course be overridden by -y.
  • rebase.prompt_accept, revert.prompt_accept β€” a boolean value indicating whether default reply to the prompt before executing the revert should be yes or no. The rebase.prompt_accept variable takes precedence over revert.prompt_accept, and both default to true, meaning to accept the revert by default.
  • rebase.strict, revert.strict β€” a boolean value that, when true, disables the revert command. The revert.strict variable takes precedence over revert.strict.
Not me copy-pasting that precedence line verbatim btw β€” that's exactly how it reads in the source. Take it up with the manpage. πŸ’€

πŸ‘‘ SQITCH πŸ‘‘

Part of the sqitch suite. One of the family, main character energy, etc etc. periodt. πŸ’œ


That's the whole page, bestie β€” perl v5.40.1, dated 2026-07-26, signed off as sqitch-rebase(3pm). Go rebase something and slay. πŸŒΈπŸ’–πŸ¦‹

πŸ“¦ where this page comes from