view release on metacpan or search on metacpan
@marc-marketparts for the report (#685).
- Fixed a bug reworking a change when a rework directory is configured
but not created. Thanks to @jfeaver for the report (#686).
- Output the list of changes to be deployed or reverted when `--verbose`
is specified at least twice. Thanks to @vectro for the PR (#702).
- Fixed the formatting of the log and plan commands to allow empty or `0`
separators in lists of things (such as `%{0}t` for a list of tags).
Thanks to @web-vertalo for the pull request (#703).
- Updated the MySQL Tutorial to use 5.7 features. Thanks to Vlad
Safronov for the PR (#705).
- Deprecated the `no_prompt` and `no_prompt` attributes of
App::Sqitch::Engine in favor of passing booleans to the `revert` and
`verify` methods. The attributes still exist for reverse compatibility,
but now emit warnings and will be removed in the future. Thanks to
Thanks to @vectro for the PR (#704).
- Added a warning for a double extension on the file names created
by the `add` command. Thanks to @blairjordan for the PR (#724)!
- Added the `revert.strict` boolean configuration variable which, when
set to true, requires the specification of a change to revert to. It
also disables the `rebase` and `checkout` commands, though the
`rebase.strict` and `checkout.strict` variables, respectively, may
- Added explicit sorting for aggregated lists (such as the tags associated
with a commit) to the MySQL, Exasol, Snowflake, and Postgres (9.0 and
higher) engines.
- Fixed slow deploys on MariaDB thanks to fractional timestamp support
added in 5.03.05. Thanks to @rbrigot for the PR (#658)!
- Fixed a bug where destination locking failed on the first deploy to
MySQL. Bug introduced along with destination locking in v1.2.0.
Thanks Tom Bloor the report and to Alberto Simões for the help
replicating the issue (#601).
- Removed the `sqitch engine update-config` action, originally added for
compatibility reasons in 2014, and the prompt to use it was removed as
of 0.9999 in 2019.
- Fixed a warning when searching for the Firebird client on Windows.
1.2.1 2021-12-05T19:59:45Z
- Updated all the live engine tests, aside from Oracle, to test with
unique registry names, so as to avoid conflicts when multiple
instances are being tested at once. Thanks to Slaven ReziÄ for the
report (#597).
- Removed `local` directory from the distribution, accidentally included
in v1.2.0. Thanks to gregor herrmann for the report (#600).
SnowSQL configuration file (`~/.snowsql/config`) before falling back on
the hard-coded warehouse name "sqitch" and using the system username as
the database name and no default for the role.
- Switched to using a constant internally to optimize windows-specific
code paths at compile time.
- When `deploy` detects undeployed dependencies, it now eliminates
duplicates before listing them in the error message.
- Now requiring IO::Pager v0.34 or later for its more consistent
interface.
- Added notes about creating databases to the tutorials. Thanks to Dave
Rolsky for the prompt (#315).
- Added a status message to tell the user when the registry is being
updated, rather than just show each individual update. Thanks to Ben
Hutton for the suggestion (#276).
- Added support for a `$SQITCH_TARGET` environment variable, which takes
precedence over all other target specifications except for command-line
options and arguments. Thanks to @mvgrimes for the suggestion (#203).
- Fixed target/engine/change argument parsing so it won't automatically
fail when `core.engine` isn't set unless no targets are found. This
lets engines be determined strictly from command-line arguments --
derived from targets, or just listed on their own -- whether or not
startup time speedup.
- Loading of App::Sqitch::DateTime is now deferred until it's needed.
This is because DateTime is rather expensive to load. Since a number of
commands don't need it, it seems silly to load it in those cases.
- Now recommend Type::Tiny::XS and Class::XSAccessor for improved
performance.
- The `check` command now properly fails on a plan parse error, instead
of blindly continuing on.
- Fixed a failing test on PostgreSQL due to localization issues. Thanks
to Sven Schoberf for the report (Issue #171).
- Added the `revert.prompt_accept`, `rebase.prompt_accept`, and
`checkout.prompt_accept` boolean configuration variables. Set these
variables to false to change the default answer to the revert prompt to
"No". When rebasing or checking out, if the variables specific to those
commands are not set, Sqitch will fall back on the value of
`revert.prompt_accept`. Suggested by Graeme Lawton (Issue #164).
- The MySQL engine now sets the `$MYSQL_PWD` environment variable if a
password is provided in a target. This should simplify authentication
when running MySQL change scripts through the `mysql` client client
(Issue #150).
- The MySQL engine now reads `client` and `mysql` groups in the MySQL
configuration files for a password when connecting to the registry
database, and when the target URI includes no password. The MySQL
client already read those files, of course, but now the internal
database connection does as well (Issue #150).
- The Firebird engine now sets the `$ISC_PASSWORD` environment variable
- Added the `rebase` command. This command combines a `revert` and a
`deploy` into a single command, which should allow for more natural
deployment testing during development. `sqitch rebase @HEAD^` should
become a common command for database developers.
- Duplicate values passed via `--requires` and `--conflicts` in the `add`
and `rework` actions are now ignored.
- The `add` command now throws an exception if `--template-directory` is
passed or specified in the configuration file, and the specified
directory does not exist or is not a directory. Thanks to Ronan Dunklau
for the report! (Issue #52).
- The `revert` command now prompts for confirmation before reverting
anything. The prompt can be skipped via the `-y` option or setting the
`revert.no_prompt` configuration variable. Works for rebase, too, which
reads `rebase.no_prompt` before `revert.no_prompt`.' (Issue #49.)
- Added the `show` command, which show information about changes or tags,
or the contents of change script files. (Issue #57.)
- Renamed the `test` scripts and planned command to `verify`.
0.938 2012-10-12T19:16:57Z
- Added a primary key to the PostgreSQL `events` table, which should make
it easier to support replication.
0.937 2012-10-09T21:54:36Z
- Fixed the `--to` option to `deploy` and `revert`, which was ignored
* Switched to event-driven colors for event types and change IDs in
default formats.
* Added color to the event type and change ID output in the "raw"
format.
- Added detailed descriptions of the default formats to `sqitch-log.pod`.
- Updated the Change object to encode and decode vertical whitespace in a
note, so that all data remains on a single line for each object in the
plan file.
- Now require a note when adding, reworking, or tagging a change. If
`--note` is not specified, an editor will be launched and the user
prompted to write a note. This is similar to how `git commit` behaves,
and encourages documentation of changes.
- Added required "project" and optional "uri" pragmas to the plan.
- Added `--project` and `--uri` attributes to the `init` command.
- Removed the `core.uri` configuration variable and corresponding core
`--uri` option (since it has been replaced with the `init` command's
`--uri` option.
- Command-line arguments are now all assumed to be UTF-8, and are parsed
as such.
- Added workaround to force the configuration file to be written and read
as UTF-8. Requires an unreleased version of Config::GitLike to actually
lib/App/Sqitch.pm view on Meta::CPAN
}
sub _readline {
my $self = shift;
return undef if $self->_is_unattended;
my $answer = <STDIN>;
chomp $answer if defined $answer;
return $answer;
}
sub prompt {
my $self = shift;
my $msg = shift or hurl 'prompt() called without a prompt message';
# use a list to distinguish a default of undef() from no default
my @def;
@def = (shift) if @_;
# use dispdef for output
my @dispdef = scalar(@def)
? ('[', (defined($def[0]) ? $def[0] : ''), '] ')
: ('', '');
# Don't use emit because it adds a newline.
lib/App/Sqitch.pm view on Meta::CPAN
if ( !defined $ans or !length $ans ) {
# Ctrl-D or user hit return;
$ans = @def ? $def[0] : '';
}
return $ans;
}
sub ask_yes_no {
my ($self, @msg) = (shift, shift);
hurl 'ask_yes_no() called without a prompt message' unless $msg[0];
my $y = __p 'Confirm prompt answer yes', 'Yes';
my $n = __p 'Confirm prompt answer no', 'No';
push @msg => $_[0] ? $y : $n if @_;
my $answer;
my $i = 3;
while ($i--) {
$answer = $self->prompt(@msg);
return 1 if $y =~ /^\Q$answer/i;
return 0 if $n =~ /^\Q$answer/i;
$self->emit(__ 'Please answer "y" or "n".');
}
hurl io => __ 'No valid answer after 3 attempts; aborting';
}
sub ask_y_n {
my $self = shift;
lib/App/Sqitch.pm view on Meta::CPAN
=head3 C<warn_literal>
$sqitch->warn('Could not find nerble; using nobble instead.');
$sqitch->warn_literal("Cannot read file: $!\n");
Send a warning messages to C<STDERR>. Warnings will have C<warning: > prefixed
to every line. Use if something unexpected happened but you can recover from
it. C<warn> appends a newline to the end of the message while C<warn_literal>
does not.
=head3 C<prompt>
my $ans = $sqitch->('Why would you want to do this?', 'because');
Prompts the user for input and returns that input. Pass in an optional default
value for the user to accept or to be used if Sqitch is running unattended. An
exception will be thrown if there is no prompt message or if Sqitch is
unattended and there is no default value.
=head3 C<ask_yes_no>
if ( $sqitch->ask_yes_no('Are you sure?', 1) ) { # do it! }
Prompts the user with a "yes" or "no" question. Returns true if the user
replies in the affirmative and false if the reply is in the negative. If the
optional second argument is passed and true, the answer will default to the
affirmative. If the second argument is passed but false, the answer will
default to the negative. When a translation library is in use, the affirmative
and negative replies from the user should be localized variants of "yes" and
"no", and will be matched as such. If no translation library is in use, the
answers will default to the English "yes" and "no".
If the user inputs an invalid value three times, an exception will be thrown.
An exception will also be thrown if there is no message. As with C<prompt()>,
an exception will be thrown if Sqitch is running unattended and there is no
default.
=head3 C<ask_y_n>
This method has been deprecated in favor of C<ask_yes_no()> and will be
removed in a future version of Sqitch.
=head2 Constants
lib/App/Sqitch/Command.pm view on Meta::CPAN
comment
comment_literal
emit
emit_literal
vent
vent_literal
warn
warn_literal
page
page_literal
prompt
ask_y_n
)],
);
has default_target => (
is => 'ro',
isa => Target,
lazy => 1,
default => sub {
my $self = shift;
lib/App/Sqitch/Command/checkout.pm view on Meta::CPAN
$sqitch->info(__x(
'Last change before the branches diverged: {last_change}',
last_change => $last_common_change->format_name_with_tags,
));
# Revert to the last common change.
$engine->set_variables( $self->_collect_revert_vars($target) );
$engine->plan( $from_plan );
try {
$engine->revert( $last_common_change->id, ! $self->no_prompt, $self->prompt_accept );
} catch {
# Rethrow unknown errors or errors with exitval > 1.
die $_ if ! eval { $_->isa('App::Sqitch::X') }
|| $_->exitval > 1
|| $_->ident eq 'revert:confirm';
# Emite notice of non-fatal errors (e.g., nothing to revert).
$self->info($_->message)
};
lib/App/Sqitch/Command/rebase.pm view on Meta::CPAN
upto => $upto,
)) if @{ $changes };
# Now get to work.
$engine->with_verify( $self->verify );
$engine->log_only( $self->log_only );
$engine->lock_timeout( $self->lock_timeout );
# Revert.
$engine->set_variables( $self->_collect_revert_vars($target) );
die unless defined $self->no_prompt;
die unless defined $self->prompt_accept;
try {
$engine->revert( $onto, ! ($self->no_prompt), $self->prompt_accept );
} catch {
# Rethrow unknown errors or errors with exitval > 1.
die $_ if ! eval { $_->isa('App::Sqitch::X') }
|| $_->exitval > 1
|| $_->ident eq 'revert:confirm';
# Emit notice of non-fatal errors (e.g., nothing to revert).
$self->info($_->message)
};
# Deploy.
lib/App/Sqitch/Command/revert.pm view on Meta::CPAN
is => 'ro',
isa => Str,
);
has modified => (
is => 'ro',
isa => Bool,
default => 0,
);
has no_prompt => (
is => 'ro',
isa => Bool
);
has prompt_accept => (
is => 'ro',
isa => Bool
);
has strict => (
is => 'ro',
lazy => 1,
default => sub {
my $self = shift;
return $self->sqitch->config->get( key => 'revert.strict' ) // 0;
lib/App/Sqitch/Command/revert.pm view on Meta::CPAN
log_only
lock_timeout
target
modified
);
if ( my $vars = $opt->{set} ) {
$params{variables} = $vars
}
$params{no_prompt} = delete $opt->{y} // $config->get(
key => 'revert.no_prompt',
as => 'bool',
) // 0;
$params{prompt_accept} = $config->get(
key => 'revert.prompt_accept',
as => 'bool',
) // 1;
return \%params;
}
sub _collect_vars {
my ($self, $target) = @_;
my $cfg = $self->sqitch->config;
return (
lib/App/Sqitch/Command/revert.pm view on Meta::CPAN
$self->warn(__x(
'Too many changes specified; reverting to "{change}"',
change => $change,
));
}
# Now get to work.
$engine->log_only( $self->log_only );
$engine->lock_timeout( $self->lock_timeout );
$engine->set_variables( $self->_collect_vars($target) );
$engine->revert( $change, ! ($self->no_prompt), $self->prompt_accept );
return $self;
}
1;
__END__
=head1 Name
App::Sqitch::Command::revert - Revert Sqitch changes from a database
lib/App/Sqitch/Command/revert.pm view on Meta::CPAN
=head3 C<lock_timeout>
The number of seconds to wait for an exclusive advisory lock on the target,
for engines that support the feature.
=head3 C<modified>
Boolean to revert to the change prior to earliest change with a revised
deploy script.
=head3 C<no_prompt>
Boolean indicating whether or not to prompt the user to really go through with
the revert.
=head3 C<prompt_accept>
Boolean value to indicate whether or not the default value for the prompt,
should the user hit C<return>, is to accept the prompt or deny it.
=head3 C<strict>
Boolean to indicate whether or not a change to revert to is required.
=head3 C<target>
The deployment target URI.
=head3 C<to_change>
lib/App/Sqitch/Engine.pm view on Meta::CPAN
sub _def_user { }
sub _def_pass { }
sub registry_destination { shift->destination }
has start_at => (
is => 'rw',
isa => Str
);
has no_prompt => (
is => 'rw',
isa => Bool,
trigger => sub {
# Deprecation notice added Feb 2023
warnings::warnif(
"deprecated",
"Engine::no_prompt is deprecated and will be removed in a future release\n"
. "Use direct arguments to revert() instead",
);
}
);
has prompt_accept => (
is => 'rw',
isa => Bool,
trigger => sub {
# Deprecation notice added Feb 2023
warnings::warnif(
"deprecated",
"Engine::prompt_accept is deprecated and will be removed in a future release\n"
. "Use direct arguments to revert() instead",
);
}
);
has log_only => (
is => 'rw',
isa => Bool,
default => 0,
);
lib/App/Sqitch/Engine.pm view on Meta::CPAN
# but for an output from $self->deployed_changes or
# $self->deployed_changes_since.
sub _format_deployed_change_name_with_tags($) {
my ( $self, $change ) = @_;
return join ' ', $change->{name}, map { '@' . $_ } @{$change->{tags}};
}
sub revert {
# $to = revert up to (but not including) this change. May be undefined.
# $prompt = If true, we ask for confirmation; if false, we don't.
# $prompt_default = Default if the user just hits enter at the prompt.
my ( $self, $to, $prompt, $prompt_default ) = @_;
if (defined $prompt) {
hurl revert => __('Missing required parameter $prompt_default')
unless defined $prompt_default;
} else {
warnings::warnif(deprecated => join ("\n",
"Engine::revert() requires the `prompt` and `prompt_default` arguments.",
'Omitting them will become fatal in a future release.',
));
$prompt = !($self->no_prompt // 0);
$prompt_default = $self->prompt_accept // 1;
}
# Check the registry and, once we know it's there, lock the destination.
$self->_check_registry;
$self->lock_destination;
my $sqitch = $self->sqitch;
my $plan = $self->plan;
my @changes;
lib/App/Sqitch/Engine.pm view on Meta::CPAN
) or do {
$sqitch->info(__x(
'No changes deployed since: "{change}"',
change => $to,
));
return $self;
};
my @change_descriptions =
map { $self->_format_deployed_change_name_with_tags($_) } @changes;
unless ($prompt) {
$sqitch->info(__x(
'Reverting changes to {change} from {destination}',
change => $change->format_name_with_tags,
destination => $self->destination,
));
$sqitch->debug(__ 'Will revert the following changes:');
map { $sqitch->debug($_) } @change_descriptions;
} else {
$sqitch->debug(__ 'Would revert the following changes:');
map { $sqitch->debug($_) } @change_descriptions;
hurl {
ident => 'revert:confirm',
message => __ 'Nothing reverted',
exitval => 1,
} unless $sqitch->ask_yes_no(__x(
'Revert changes to {change} from {destination}?',
change => $change->format_name_with_tags,
destination => $self->destination,
), $prompt_default );
}
} else {
# NB this is an array of unblessed references, not of
# Sqitch::Plan::Change references.
@changes = $self->deployed_changes or do {
$sqitch->info(__ 'Nothing to revert (nothing deployed)');
return $self;
};
my @change_descriptions =
map { $self->_format_deployed_change_name_with_tags($_) } @changes;
unless ($prompt) {
$sqitch->info(__x(
'Reverting all changes from {destination}',
destination => $self->destination,
));
$sqitch->debug(__ 'Will revert the following changes:');
map { $sqitch->debug($_) } @change_descriptions;
} else {
$sqitch->debug(__ 'Would revert the following changes:');
map { $sqitch->debug($_) } @change_descriptions;
hurl {
ident => 'revert',
message => __ 'Nothing reverted',
exitval => 1,
} unless $sqitch->ask_yes_no(__x(
'Revert all changes from {destination}?',
destination => $self->destination,
), $prompt_default );
}
}
# Make change objects and check that all dependencies will be satisfied.
@changes = reverse $self->_load_changes( @changes );
$self->check_revert_dependencies(@changes);
# Do we want to support modes, where failures would re-deploy to previous
# tag or all the way back to the starting point? This would be very much
# like deploy() mode. I'm thinking not, as a failure on a revert is not
lib/App/Sqitch/Engine/exasol.pm view on Meta::CPAN
[ c => $uri->host && $uri->_port ? $uri->host . ':' . $uri->_port : undef ],
[ profile => $uri->host ? undef : $uri->dbname ],
[ jdbcparam => ($qry->{SSLCERTIFICATE} || '') eq 'SSL_VERIFY_NONE' ? 'validateservercertificate=0' : undef ],
[ jdbcparam => $qry->{AUTHMETHOD} ? "authmethod=$qry->{AUTHMETHOD}" : undef ],
) {
push @ret, "-$spec->[0]" => $spec->[1] if $spec->[1];
}
push @ret => (
'-q', # Quiet mode
'-L', # Don't prompt if login fails, just exit
'-pipe', # Enable piping of scripts to 'exaplus'
'-x', # Stop in case of errors
'-autoCompletion' => 'OFF',
'-encoding' => 'UTF8',
'-autocommit' => 'OFF',
);
return \@ret;
},
);
lib/App/Sqitch/Plan/Change.pm view on Meta::CPAN
my $plan = $self->plan;
return map { $plan->find( $_->key_name ) } $self->requires;
}
sub conflicts_changes {
my $self = shift;
my $plan = $self->plan;
return map { $plan->find( $_->key_name ) } $self->conflicts;
}
sub note_prompt {
my ( $self, %p ) = @_;
return join(
'',
__x(
"Please enter a note for your change. Lines starting with '#' will\n" .
"be ignored, and an empty message aborts the {command}.",
command => $p{for},
),
"\n",
lib/App/Sqitch/Plan/Change.pm view on Meta::CPAN
Returns an L<IO::File> file handle, opened for reading, for the revert script
for the change.
=head3 C<verify_handle>
my $fh = $change->verify_handle;
Returns an L<IO::File> file handle, opened for reading, for the verify script
for the change.
=head3 C<note_prompt>
my $prompt = $change->note_prompt(
for => 'rework',
scripts => [$change->deploy_file, $change->revert_file],
);
Overrides the implementation from C<App::Sqitch::Plan::Line> to add the
C<files> parameter. This is a list of the files to be created for the command.
These will usually be the deploy, revert, and verify files, but the caller
might not be creating all of them, so it needs to pass the list.
=head1 See Also
lib/App/Sqitch/Plan/Line.pm view on Meta::CPAN
sub request_note {
my ( $self, %p ) = @_;
my $note = $self->note // '';
return $note if $note =~ /\S/;
# Edit in a file.
require File::Temp;
my $tmp = File::Temp->new;
binmode $tmp, ':utf8_strict';
( my $prompt = $self->note_prompt(%p) ) =~ s/^/# /gms;
$tmp->print( "\n", $prompt, "\n" );
$tmp->close;
my $sqitch = $self->sqitch;
$sqitch->shell( $sqitch->editor . ' ' . $sqitch->quote_shell($tmp) );
open my $fh, '<:utf8_strict', $tmp or hurl add => __x(
'Cannot open {file}: {error}',
file => $tmp,
error => $!
);
lib/App/Sqitch/Plan/Line.pm view on Meta::CPAN
# Trim the note.
$note =~ s/\A\v+//;
$note =~ s/\v+\z//;
# Set the note.
$self->note($note);
return $note;
}
sub note_prompt {
my ( $self, %p ) = @_;
__x(
"Write a {command} note.\nLines starting with '#' will be ignored.",
command => $p{for}
);
}
sub format_name {
shift->name;
}
lib/App/Sqitch/Plan/Line.pm view on Meta::CPAN
my $note = $line->request_note( for => 'add' );
Request the note from the user. Pass in the name of the command for which the
note is requested via the C<for> parameter. If there is a note, it is simply
returned. Otherwise, an editor will be launched and the user asked to write
one. Once the editor exits, the note will be retrieved from the file, saved,
and returned. If no note was written, an exception will be thrown with an
C<exitval> of 1.
=head3 C<note_prompt>
my $prompt = $line->note_prompt( for => 'tag' );
Returns a localized string for use in the temporary file created by
C<request_note()>. Pass in the name of the command for which to prompt via the
C<for> parameter.
=head1 See Also
=over
=item L<App::Sqitch::Plan>
Class representing a plan.
lib/App/Sqitch/Role/RevertDeployCommand.pm view on Meta::CPAN
default => 0,
);
has lock_timeout => (
is => 'ro',
isa => Int,
lazy => 1,
default => sub { App::Sqitch::Engine::default_lock_timeout() },
);
has no_prompt => (
is => 'ro',
isa => Bool
);
has prompt_accept => (
is => 'ro',
isa => Bool
);
has mode => (
is => 'ro',
isa => enum([qw(
change
tag
all
lib/App/Sqitch/Role/RevertDeployCommand.pm view on Meta::CPAN
}
if ( my $vars = $opt->{set_revert} ) {
# --set-revert used only for revert.
$params->{revert_variables} = {
%{ $params->{revert_variables} || {} },
%{ $vars },
};
}
$params->{no_prompt} = delete $opt->{y} // $config->get(
key => "$cmd.no_prompt",
as => 'bool',
) // $config->get(
key => 'revert.no_prompt',
as => 'bool',
) // 0;
$params->{prompt_accept} = $config->get(
key => "$cmd.prompt_accept",
as => 'bool',
) // $config->get(
key => 'revert.prompt_accept',
as => 'bool',
) // 1;
return $params;
};
1;
__END__
lib/App/Sqitch/Role/RevertDeployCommand.pm view on Meta::CPAN
=head3 C<log_only>
Boolean indicating whether to log the deploy without running the scripts.
=head3 C<lock_timeout>
The number of seconds to wait for an exclusive advisory lock on the target,
for engines that support the feature.
=head3 C<no_prompt>
Boolean indicating whether or not to prompt the user to really go through with
the revert.
=head3 C<prompt_accept>
Boolean value to indicate whether or not the default value for the prompt,
should the user hit C<return>, is to accept the prompt or deny it.
=head3 C<strict>
Boolean value to indicate whether or not strict mode is enabled; if
so, use of these commands is prohibited.
=head3 C<target>
The deployment target URI.
lib/sqitch-add.pod view on Meta::CPAN
=item C<-f>
Path to the deployment plan file. Overrides target, engine, and core
configuration values. Defaults to F<$top_dir/sqitch.plan>.
=back
=head1 Examples
Add a change to a project and be prompted for a note.
sqitch add widgets
Add a change and specify the note.
sqitch add sprockets --note 'Adds the sprockets table.'
Add a change that requires the C<users> change from earlier in the plan.
sqitch add contacts --requires users -n 'Adds the contacts table'
lib/sqitch-checkout-usage.pod view on Meta::CPAN
-t --target <target> database to which to connect
--mode <mode> deploy failure reversion mode (all, tag, or change)
--verify run verify scripts after deploying each change
--no-verify do not run verify scripts
-s --set <key=value> set a database client variable
-r --set-revert <key=value> set a database client revert variable
-e --set-deploy <key=value> set a database client deploy variable
--log-only log changes without running them
--lock-timeout <timeout> seconds to wait for target lock
-y disable the prompt before reverting
--registry <registry> registry schema or database
--db-client <path> path to the engine command-line client
-d --db-name <name> database name
-u --db-user <user> database user name
-h --db-host <host> database server host name
-p --db-port <port> database server port number
-f --plan-file <file> path to a deployment plan file
lib/sqitch-checkout.pod view on Meta::CPAN
sqitch checkout --lock-timeout 600
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.
=item C<-y>
Disable the prompt that normally asks whether or not to execute the revert.
=item C<--registry>
sqitch checkout --registry registry
The name of the Sqitch registry schema or database in which sqitch stores its
own data.
=item C<--db-client>
lib/sqitch-checkout.pod view on Meta::CPAN
=item C<deploy.verify>
Boolean indicating whether or not to verify each change after deploying it.
=item C<checkout.mode>
=item C<deploy.mode>
Deploy mode. The supported values are the same as for the C<--mode> option.
=item C<checkout.no_prompt>
=item C<revert.no_prompt>
A boolean value indicating whether or not to disable the prompt before
executing the revert. The C<checkout.no_prompt> variable takes precedence over
C<revert.no_prompt>, and both may of course be overridden by C<-y>.
=item C<checkout.prompt_accept>
=item C<revert.prompt_accept>
A boolean value indicating whether default reply to the prompt before
executing the revert should be "yes" or "no". The C<checkout.prompt_accept>
variable takes precedence over C<revert.prompt_accept>, and both default to
true, meaning to accept the revert.
=item C<checkout.strict>
=item C<revert.strict>
A boolean value that, when true, disables the C<checkout> command. The
C<checkout.strict> variable takes precedence over C<revert.strict>.
When the checkout command is disabled, use the C<deploy> and C<revert>
lib/sqitch-configuration.pod view on Meta::CPAN
Verify: sqlite/verify
Reworked Script Directories:
Reworked: sqlite
Deploy: sqlite/deploy
Revert: sqlite/revert
Verify: sqlite/verify
No Variables
Now deploying any of these databases is as simple as specifying the target
name when executing the L<C<deploy>|sqitch-deploy> command (assuming the
C<sqitch> user is configured to authenticate to PostgreSQL without prompting
for a password):
> sqitch deploy prod-primary
> sqitch deploy prod-standby
Want them all? Just query the targets and pass each in turn:
for target in `sqitch target | grep prod-`; do
sqitch deploy $target
done
lib/sqitch-rebase-usage.pod view on Meta::CPAN
--onto --onto-change <change> revert to change
--upto --upto-change <change> deploy to change
--mode <mode> deploy reversion mode (all, tag, change)
--verify run verify scripts after each change
--no-verify do not run verify scripts
-s --set <key=value> set a database client variable
-r --set-revert <key=value> set a database client revert variable
-e --set-deploy <key=value> set a database client deploy variable
--log-only log changes without running them
--lock-timeout <timeout> seconds to wait for target lock
-y disable the prompt before reverting
--registry <registry> registry schema or database
--db-client <path> path to the engine command-line client
-d --db-name <name> database name
-u --db-user <user> database user name
-h --db-host <host> database server host name
-p --db-port <port> database server port number
-f --plan-file <file> path to a deployment plan file
lib/sqitch-rebase.pod view on Meta::CPAN
sqitch rebase --lock-timeout 600
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.
=item C<-y>
Disable the prompt that normally asks whether or not to execute the revert.
=item C<--registry>
sqitch rebase --registry registry
The name of the Sqitch registry schema or database in which sqitch stores its
own data.
=item C<--db-client>
lib/sqitch-rebase.pod view on Meta::CPAN
=item C<deploy.verify>
Boolean indicating whether or not to verify each change after deploying it.
=item C<rebase.mode>
=item C<deploy.mode>
Deploy mode. The supported values are the same as for the C<--mode> option.
=item C<rebase.no_prompt>
=item C<revert.no_prompt>
A boolean value indicating whether or not to disable the prompt before
executing the revert. The C<rebase.no_prompt> variable takes precedence over
C<revert.no_prompt>, and both may of course be overridden by C<-y>.
=item C<rebase.prompt_accept>
=item C<revert.prompt_accept>
A boolean value indicating whether default reply to the prompt before
executing the revert should be "yes" or "no". The C<rebase.prompt_accept>
variable takes precedence over C<revert.prompt_accept>, and both default to
true, meaning to accept the revert by default.
=item C<rebase.strict>
=item C<revert.strict>
A boolean value that, when true, disables the C<revert> command. The
C<revert.strict> variable takes precedence over C<revert.strict>.
=back
lib/sqitch-revert-usage.pod view on Meta::CPAN
sqitch revert [options] [<database>]
=head1 Options
-t --target <target> database to which to connect
--to-change <change> revert to change
-m --modified revert to before the earliest modified change
-s --set <key=value> set a database client variable
--log-only log changes without running them
--lock-timeout <timeout> seconds to wait for target lock
-y disable the prompt before reverting
--registry <registry> registry schema or database
--db-client <path> path to the engine command-line client
-d --db-name <name> database name
-u --db-user <user> database user name
-h --db-host <host> database server host name
-p --db-port <port> database server port number
-f --plan-file <file> path to a deployment plan file
lib/sqitch-revert.pod view on Meta::CPAN
sqitch deploy --lock-timeout 600
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 deploying to the target at the
same time, but prevents no other database activity. Defaults to 60.
=item C<-y>
Disable the prompt that normally asks whether or not to execute the revert.
=item C<--registry>
sqitch revert --registry registry
The name of the Sqitch registry schema or database in which sqitch stores its
own data.
=item C<--db-client>
lib/sqitch-revert.pod view on Meta::CPAN
=item C<core.variables>
=back
=item C<revert.strict>
A boolean value indicating whether or not the change to revert to must
be specified.
=item C<revert.no_prompt>
A boolean value indicating whether or not to disable the prompt before
executing the revert. May be overridden by C<-y>.
=item C<revert.prompt_accept>
A boolean value indicating whether default reply to the prompt before
executing the revert should be "yes" or "no". Defaults to true, meaning to
accept the revert.
=back
=head1 Sqitch
Part of the L<sqitch> suite.
lib/sqitch-rework.pod view on Meta::CPAN
=item C<-f>
Path to the deployment plan file. Overrides target, engine, and core
configuration values. Defaults to F<$top_dir/sqitch.plan>.
=back
=head1 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 C<users> change from earlier in the plan.
sqitch rework contacts --requires users -n 'Reworks the contacts view.'
lib/sqitch-tag.pod view on Meta::CPAN
sqitch tag --all
Get a list of the tags in the plan used by the C<pg> engine:
sqitch tag pg
Get a list of the tags in two specific plans:
sqitch tag sqlite.plan pg.plan
Tag the latest change in the default project plan and be prompted for a note.
sqitch tag alpha1
Tag the latest change in all project plans and be prompted for a note.
sqitch tag alpha1 --all
Tag the latest change in the default project plan and and specify the note.
sqitch tag alpha2 -n 'Tag @alpha2.'
Tag change C<users> in the default plan:
sqitch tag --tag alpha3 --change users
lib/sqitchtutorial-clickhouse.pod view on Meta::CPAN
# By: Marge N. OâVera <marge@example.com>
#
Nothing to deploy (up-to-date)
Let's make sure that we can revert the change:
> sqitch revert 'db:clickhouse://default@localhost/flipr_test?Driver=ClickHouse'
Revert all changes from db:clickhouse://default@localhost/flipr_test?Driver=ClickHouse? [Yes]
- users .. ok
The L<C<revert>|sqitch-revert> command first prompts to make sure that we
really do want to revert. This is to prevent unnecessary accidents. You can
pass the C<-y> option to disable the prompt. Also, notice the C<-> before the
change name in the output, which reinforces that the change is being
I<removed> from the database. And now the schema should be gone:
> clickhouse client -d flipr_test -q 'show tables'
And the status message should reflect as much:
> sqitch status 'db:clickhouse://default@localhost/flipr_test?Driver=ClickHouse'
# On database db:clickhouse://default@localhost/flipr_test?Driver=ClickHouse
No changes deployed
lib/sqitchtutorial-exasol.pod view on Meta::CPAN
# By: Marge N. OâVera <marge@example.com>
#
Nothing to deploy (up-to-date)
Let's make sure that we can revert the change:
> sqitch revert 'db:exasol://sys:exasol@localhost:8563/?Driver=Exasol'
Revert all changes from db:exasol://sys:@localhost:8563/?Driver=Exasol? [Yes]
- appschema .. ok
The L<C<revert>|sqitch-revert> command first prompts to make sure that we
really do want to revert. This is to prevent unnecessary accidents. You can
pass the C<-y> option to disable the prompt. Also, notice the C<-> before the
change name in the output, which reinforces that the change is being
I<removed> from the database. And now the schema should be gone:
> exaplus -q -u sys -p exasol -c localhost:8563 -sql "select schema_name from exa_schemas;"
SCHEMA_NAME
--------------------------------------------------------------------------------------------------------------------------------
SQITCH
And the status message should reflect as much:
lib/sqitchtutorial-firebird.pod view on Meta::CPAN
# By: Marge N. OâVera <marge@example.com>
#
Nothing to deploy (up-to-date)
Let's make sure that we can revert the change:
> sqitch revert db:firebird://sysdba:masterkey@localhost//tmp/flipr_test/flipr.fdb
Revert all changes from db:firebird://sysdba:@localhost//tmp/flipr_test/flipr.fdb? [Yes]
- users .. ok
The L<C<revert>|sqitch-revert> command first prompts to make sure that we
really do want to revert. This is to prevent unnecessary accidents. You can
pass the C<-y> option to disable the prompt. Also, notice the C<-> before the
change name in the output, which reinforces that the change is being
I<removed> from the database. And now the C<users> table should be gone:
> echo "CONNECT 'localhost:/tmp/flipr_test/flipr.fdb'; SHOW TABLES; quit;" \
| isql-fb -q -u SYSDBA -p masterkey
There are no tables in this database
And the status message should reflect as much:
> sqitch status db:firebird://sysdba:masterkey@localhost//tmp/flipr_test/flipr.fdb
lib/sqitchtutorial-mysql.pod view on Meta::CPAN
# By: Marge N. OâVera <marge@example.com>
#
Nothing to deploy (up-to-date)
Let's make sure that we can revert the change:
> sqitch revert db:mysql://root@/flipr_test
Revert all changes from db:mysql://root@/flipr_test? [Yes]
- appuser .. ok
The L<C<revert>|sqitch-revert> command first prompts to make sure that we
really do want to revert. This is to prevent unnecessary accidents. You can
pass the C<-y> option to disable the prompt. Also, notice the C<-> before the
change name in the output, which reinforces that the change is being
I<removed> from the database. And now the schema should be gone:
> mysql -u root --execute "SELECT user from mysql.user WHERE user = 'flipr';"
And the status message should reflect as much:
> sqitch status db:mysql://root@/flipr_test
# On database db:mysql://root@/flipr_test
No changes deployed
lib/sqitchtutorial-oracle.pod view on Meta::CPAN
# By: Marge N. OâVera <marge@example.com>
#
Nothing to deploy (up-to-date)
Let's make sure that we can revert the change:
> sqitch revert db:oracle://scott:tiger@/flipr_test
Revert all changes from db:oracle://scott:@/flipr_test? [Yes]
- appschema .. ok
The L<C<revert>|sqitch-revert> command first prompts to make sure that we
really do want to revert. This is to prevent unnecessary accidents. You can
pass the C<-y> option to disable the prompt. Also, notice the C<-> before the
change name in the output, which reinforces that the change is being
I<removed> from the database. And now the schema should be gone:
> echo "SELECT username FROM all_users WHERE username = 'FLIPR';" \
| sqlplus -S scott/tiger@flipr_test
no rows selected
And the status message should reflect as much:
> sqitch status db:oracle://scott:tiger@/flipr_test
lib/sqitchtutorial-snowflake.pod view on Meta::CPAN
# By: Marge N. OâVera <marge@example.com>
#
Nothing to deploy (up-to-date)
Let's make sure that we can revert the change:
> sqitch revert 'db:snowflake://movera@example/flipr?Driver=Snowflake'
Revert all changes from db:snowflake://movera@example/flipr?Driver=Snowflake? [Yes]
- appschema .. ok
The L<C<revert>|sqitch-revert> command first prompts to make sure that we
really do want to revert. This is to prevent unnecessary accidents. You can
pass the C<-y> option to disable the prompt. Also, notice the C<-> before the
change name in the output, which reinforces that the change is being
I<removed> from the database. And now the schema should be gone:
> snowsql --accountname example --username movera --dbname flipr -o friendly=false \
--query "SHOW TERSE SCHEMAS LIKE 'flipr'"
+------------+------+------+---------------+-------------+
| created_on | name | kind | database_name | schema_name |
|------------+------+------+---------------+-------------|
+------------+------+------+---------------+-------------+
0 Row(s) produced. Time Elapsed: 0.204s
lib/sqitchtutorial-sqlite.pod view on Meta::CPAN
# By: Marge N. OâVera <marge@example.com>
#
Nothing to deploy (up-to-date)
Let's make sure that we can revert the change:
> sqitch revert db:sqlite:flipr_test.db
Revert all changes from db:sqlite:flipr_test.db? [Yes]
- users .. ok
The L<C<revert>|sqitch-revert> command first prompts to make sure that we
really do want to revert. This is to prevent unnecessary accidents. You can
pass the C<-y> option to disable the prompt. Also, notice the C<-> before the
change name in the output, which reinforces that the change is being
I<removed> from the database. And now the schema should be gone:
> sqlite3 flipr_test.db '.tables'
And the status message should reflect as much:
> sqitch status db:sqlite:flipr_test.db
# On database db:sqlite:flipr_test.db
No changes deployed
lib/sqitchtutorial-vertica.pod view on Meta::CPAN
# By: Marge N. OâVera <marge@example.com>
#
Nothing to deploy (up-to-date)
Let's make sure that we can revert the change:
> sqitch revert 'db:vertica://dbadmin:password@localhost:5433/dbadmin?Driver=Vertica'
Revert all changes from db:vertica://dbadmin:@localhost:5433/dbadmin?Driver=Vertica? [Yes]
- appschema .. ok
The L<C<revert>|sqitch-revert> command first prompts to make sure that we
really do want to revert. This is to prevent unnecessary accidents. You can
pass the C<-y> option to disable the prompt. Also, notice the C<-> before the
change name in the output, which reinforces that the change is being
I<removed> from the database. And now the schema should be gone:
> vsql -U dbadmin -c '\dn flipr'
List of schemas
Name | Owner | Comment
------+-------+---------
(0 rows)
And the status message should reflect as much: