=pod

=head1 NAME

DBIx::Migration::CLI - Seamless database up- and downgrades CLI

=head1 VERSION

0.15

=head1 SYNOPSIS

=over

=item dbix-migration [ B<-V> | B<-h> ]

=item dbix-migration [ B<-v> ] [ B<-u> I<username> ] [ B<-p> I<password> ] [ B<-s> I<schema> ] I<dsn> [ I<directory> [ I<version> ] ]

=back

=head1 DESCRIPTION

This script prints the current migration version if invoked with the I<dsn>
argument only. The script applies the migrations up to the given target
I<version> if the I<direction> and I<version> arguments are specified too. If
the I<version> is missing the latest migration version will be used.

=head1 OPTIONS

=over

=item B<-V> Print version information and exit.

=item B<-h> Print long help message and exit.

=item B<-v> Print verbose information.

=item B<-u> I<username> Set database username.

=item B<-p> I<password> Set database password.

=item B<-s> I<schema> Set tracking schema.

=back

=head1 ARGUMENTS

=over

=item I<dsn> Data source name.

=item I<directory> Directory that contains the migrations.

=item I<version> Version to migrate to. If not specified the latest migration will be taken.

=back

=head1 METHODS

=over

=item run()

Executes this script and returns a proper C<exit()> argument value.

=back

=head1 EXAMPLES

  dbix-migration -s dbixm 'dbi:Pg:service=myapp;options=--search_path=myschema' ~/Projects/myapp/db/migrations 2

initiates a migration to the target version 2. The tracking schema is "dbixm".
The managed schema is "myschema". The connection details are configured in a
service file and extracted from there using the service name "myapp".

=head1 SEE ALSO

L<DBIx::Migration>

=head1 AUTHOR

Sebastian Riedel, <kraihx@gmail.com>

=head1 CONTRIBUTORS

Sven Willenbuecher, <sven.willenbuecher@gmx.de>

=head1 COPYRIGHT

Copyright 2004-2005 Sebastian Riedel. All rights reserved.

This library is free software, you can redistribute it and/or modify it under
the same terms as Perl itself.

=cut
