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. Peepsqitchchangesfor 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,sqitchchangeshas 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 bename=value, e.g.,--set defuser='Homer Simpson'. Overrides any values loaded fromconfiguration 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 bename=value, e.g.,--set defuser='Homer Simpson'. Overrides any values from--setor values loaded fromconfiguration 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 bename=value, e.g.,--set defuser='Homer Simpson'. Overrides any values from--setor values loaded fromconfiguration 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 to60. 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 π
[deploy.variables],[revert.variables]β a section defining database client variables. These variables are super useful if your database engine supports variables in scripts, such as PostgreSQL'spsqlvariables (https://www.postgresql.org/docs/current/static/app-psql.html#APP-PSQL-INTERPOLATION), Vertica'svsqlvariables (https://docs.vertica.com/24.2.x/en/connecting-to/using-vsql/variables/), MySQL's user variables (https://dev.mysql.com/doc/refman/5.6/en/user-variables.html), SQL*Plus'sDEFINEvariables (https://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12017.htm), Snowflake's SnowSQL variables (https://docs.snowflake.com/en/user-guide/snowsql-use.html#using-variables), and ClickHouse's queries with parameters (https://clickhouse.com/docs/interfaces/cli#cli-queries-with-parameters).
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--modeoption.rebase.no_prompt,revert.no_promptβ a boolean value indicating whether or not to disable the prompt before executing the revert. Therebase.no_promptvariable takes precedence overrevert.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 beyesorno. Therebase.prompt_acceptvariable takes precedence overrevert.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 therevertcommand. Therevert.strictvariable takes precedence overrevert.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
- ubuntu stonking: sqitch 1.6.1-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms