Sqitch

sqitch-rework

Name

sqitch-rework - Rework a database change

Synopsis

sqitch  rework [options] [<dependency-options>] name

Description

This command allows for the reworking of an existing database change. It is best used only under the following circumstances:

If all of these hold, then feel free to rework an existing change.

In effect, reworking a change is similar to adding one. However, rather than writing new files for the change, the rework command copies the files for the existing change. The new files are named with the tag that comes between the changes, and serves as the file for the original change. This leaves you free to edit the existing files.

By default, the rework command will rework the change in the default plan and the scripts to any top directories for that plan, as defined by the core configuration and command-line options. This works well for projects in which there is a single plan with separate top directories for each engine, for example. Pass the --all option to have it iterate over all known plans and top directories (as specified for engines and targets) and rework the change to them all. Of course, the a change by that name must exist in all the plans of the reworking will fail.

To specify which plans to in which to rework the change, pass the target, engine, or plan file names to tag as arguments. Use --change to disambiguate the and change name from the other parameters if necessary (or preferable). See “Examples” for examples.

Options

Examples

Rework a change in a project and be prompted for a note.

sqitch rework widgets

Rework a change and specify the note.

sqitch rework sprockets --note 'Reworks the sprockets view.'

Rework a change that requires the users change from earlier in the plan.

sqitch rework contacts --requires users -n 'Reworks the contacts view.'

Rework a change that requires multiple changes, including the change named extract from a completely different Sqitch project named utilities:

sqitch rework coffee -r users -r utilities:extract -n 'Mmmmm...coffee!'

Rework a change only to the plan used by the vertica engine in a project:

sqitch rework --change logs vertica -n 'Reworks the logs view in Vertica.'

Rework a change in two plans in a project, and generate the scripts only for those plans:

sqitch rework -a coolfunctions sqlite.plan pg.plan -n 'Reworks functions.'

Configuration Variables

Sqitch

Part of the sqitch suite.