Skip to content
This repository has been archived by the owner on Jul 20, 2019. It is now read-only.

Commit

Permalink
Import into git.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Sully committed Oct 19, 2010
0 parents commit 6567256
Show file tree
Hide file tree
Showing 16 changed files with 582 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Build.PL
@@ -0,0 +1,18 @@
use strict;
use Module::Build;

my $build = Module::Build->new(
create_makefile_pl => 'passthrough',
license => 'perl',
module_name => 'DBIx::Migration',
requires => {
'File::Slurp' => 0,
'File::Spec' => 0,
'DBI' => 0,
'Class::Accessor::Fast' => 0
},
create_readme => 1,
script_files => [ glob('script/*') ],
test_files => [ glob('t/*.t') ]
);
$build->create_build_script;
20 changes: 20 additions & 0 deletions Changes
@@ -0,0 +1,20 @@
Tis file documents the revision history for Perl extension DBIx::Migration.

0.05 2006-06-06 12:44:12 PDT 2006

- Fixed to work on Win32 (remove glob calls)
- Use 'name' instead of 'key' for the dbix_migration table, as 'key'
is a reserved word in many/most databases.

0.04 2005-11-18 00:00:00
- Fixed multi-digit revisions (David Christensen)
- Added sql comment support

0.03 2005-10-26 00:00:00
- Fixed the multiple sql statement bug

0.02 2005-10-24 01:00:00
- default to newest version

0.01 2005-10-24 00:00:00
- first release
16 changes: 16 additions & 0 deletions MANIFEST
@@ -0,0 +1,16 @@
Build.PL
Changes
lib/DBIx/Migration.pm
MANIFEST This list of files
script/dbix-migration.pl
t/01use.t
t/02pod.t
t/03podcoverage.t
t/04sqlite.t
t/sql/sqlite_1_down.sql
t/sql/sqlite_1_up.sql
t/sql/sqlite_2_down.sql
t/sql/sqlite_2_up.sql
META.yml
Makefile.PL
README
17 changes: 17 additions & 0 deletions META.yml
@@ -0,0 +1,17 @@
---
name: DBIx-Migration
version: 0.05
author:
- 'Sebastian Riedel, C<sri@oook.de>'
abstract: 'Seamless DB schema up- and downgrades'
license: perl
requires:
Class::Accessor::Fast: 0
DBI: 0
File::Slurp: 0
File::Spec: 0
provides:
DBIx::Migration:
file: lib/DBIx/Migration.pm
version: 0.05
generated_by: Module::Build version 0.2611
31 changes: 31 additions & 0 deletions Makefile.PL
@@ -0,0 +1,31 @@
# Note: this file was auto-generated by Module::Build::Compat version 0.03

unless (eval "use Module::Build::Compat 0.02; 1" ) {
print "This module requires Module::Build to install itself.\n";

require ExtUtils::MakeMaker;
my $yn = ExtUtils::MakeMaker::prompt
(' Install Module::Build now from CPAN?', 'y');

unless ($yn =~ /^y/i) {
die " *** Cannot install without Module::Build. Exiting ...\n";
}

require Cwd;
require File::Spec;
require CPAN;

# Save this 'cause CPAN will chdir all over the place.
my $cwd = Cwd::cwd();
my $makefile = File::Spec->rel2abs($0);

CPAN::Shell->install('Module::Build::Compat')
or die " *** Cannot install without Module::Build. Exiting ...\n";

chdir $cwd or die "Cannot chdir() back to $cwd: $!";
}
eval "use Module::Build::Compat 0.02; 1" or die $@;
use lib '_build/lib';
Module::Build::Compat->run_build_pl(args => \@ARGV);
require Module::Build;
Module::Build::Compat->write_makefile(build_class => 'Module::Build');
65 changes: 65 additions & 0 deletions README
@@ -0,0 +1,65 @@
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.

0 comments on commit 6567256

Please sign in to comment.