Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

DBIx::Migration

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 script
Octocat-spinner-32 t
Octocat-spinner-32 Build.PL
Octocat-spinner-32 Changes
Octocat-spinner-32 MANIFEST
Octocat-spinner-32 META.yml
Octocat-spinner-32 Makefile.PL
Octocat-spinner-32 README
README
NAME
    DBIx::Migration - Seamless DB schema up- and downgrades

SYNOPSIS
        # 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;

DESCRIPTION
    Seamless DB schema up- and downgrades.

METHODS
    $self->debug($debug)
        Enable/Disable debug messages.

    $self->dir($dir)
        Get/Set directory.

    $self->dsn($dsn)
        Get/Set dsn.

    $self->migrate($version)
        Migrate database to version.

    $self->password
        Get/Set database password.

    $self->username($username)
        Get/Set database username.

    $self->version
        Get migration version from database.

AUTHOR
    Sebastian Riedel, "sri@oook.de"

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

Something went wrong with that request. Please try again.