DBIx::Migration - Seamless DB schema up- and downgrades
# migrate.pl my $m = DBIx::Migration->new( { dsn => 'dbi:SQLite:/Users/sri/myapp/db/sqlite/myapp.db', dir => '/Users/sri/myapp/db/sqlite' } ); my $version = $m->version; # Get current version from database $m->migrate(2); # Migrate database to version 2 # /Users/sri/myapp/db/sqlite/schema_1_up.sql CREATE TABLE foo ( id INTEGER PRIMARY KEY, bar TEXT ); # /Users/sri/myapp/db/sqlite/schema_1_down.sql DROP TABLE foo; # /Users/sri/myapp/db/sqlite/schema_2_up.sql CREATE TABLE bar ( id INTEGER PRIMARY KEY, baz TEXT ); # /Users/sri/myapp/db/sqlite/schema_2_down.sql DROP TABLE bar;
Seamless DB schema up- and downgrades.
Enable/Disable debug messages.
Get/Set directory.
Get/Set dsn.
Migrate database to version.
Get/Set database password.
Get/Set database username.
Get migration version from database.
Sebastian Riedel, sri@oook.de
sri@oook.de
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
To install DBIx::Migration, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Migration
CPAN shell
perl -MCPAN -e shell install DBIx::Migration
For more information on module installation, please visit the detailed CPAN module installation guide.