Permalink
Browse files

prep for cpan

  • Loading branch information...
1 parent cb0eeaf commit 2cab710d3b9ec28d5a531cb984100c3ed243c827 @jjn1056 jjn1056 committed Feb 29, 2012
View
@@ -1,5 +1,12 @@
Revision history for DBIx-Class-Migration
+0.007 29 February 2012
+ - Catalyst::TraitFor::Model::DBIC::Schema::FromMigration now lets you
+ set some connect_info args instead of deleting them.
+ - silence some warnings about my unclear use of 'shift'
+ - Fixed a use.t problem where I was trying to check a module that had
+ optional dependencies
+
0.006 28 February 2012
- let you dump fixtures from an unversioned DB, but warn about it.
- FAQ entry about this
View
@@ -5,7 +5,7 @@ copyright_holder = John Napiorkowski
copyright_year = 2012
abstract = Make it easy to migrate DBIC based databases
-version = 0.006
+version = 0.007
[@Basic]
[Prereqs]
@@ -11,8 +11,7 @@ around BUILDARGS => sub {
my ($orig, $class, @args) = @_;
my $args = $class->$orig(@args);
- die "Can't use 'connect_info' with the 'FromMigration' trait."
- if $args->{connect_info};
+ my $connect_info = (delete $args->{connect_info}) || {};
my %init_args = (
schema_class => $args->{schema_class},
@@ -24,8 +23,9 @@ around BUILDARGS => sub {
->new(%init_args);
$args->{migration_helper} = $migration_helper;
- $args->{connect_info} = sub {
- $migration_helper->migration->schema->storage->dbh;
+ $args->{connect_info} = {
+ dbh_maker => sub { $migration_helper->migration->schema->storage->dbh },
+ ref $connect_info eq 'HASH' ? %$connect_info : @$connect_info,
};
return $args;
@@ -1,6 +1,6 @@
package DBIx::Class::Migration;
-our $VERSION = "0.006";
+our $VERSION = "0.007";
use Moose;
use JSON::XS;
@@ -333,7 +333,7 @@ sub build_dbic_fixtures {
my $dbic_fixtures = (my $self = shift)->dbic_fixture_class;
my $version = $self->dbic_dh->version_storage_is_installed ?
$self->dbic_dh->database_version : do {
- print "Since this database is not versioned, we will assume version";
+ print "Since this database is not versioned, we will assume version ";
print "${\$self->dbic_dh->schema_version}\n";
$self->dbic_dh->schema_version;
};
@@ -21,7 +21,7 @@ sub _make_schema_at {
}
sub _next_cnt { our $_cnt++ }
-sub _as_unique_ns { shift . _next_cnt() }
+sub _as_unique_ns { $_[0] . _next_cnt() }
sub schema_from_database {
my ($self, $ns) = @_;
@@ -164,8 +164,8 @@ would look like so:
schema_class => 'MusicBase::Schema',
extra_migration_args => {
db_sandbox_class => 'DBIx::Class::Migration::MySQLSandbox'},
- install_if_needed => {
- default_fixture_sets => ['all_tables']},
+ install_if_needed => {
+ default_fixture_sets => ['all_tables']},
},
In any case, you hopefully noticed that we also run some setup code to install
View
10 t/use.t
@@ -2,10 +2,10 @@ use Test::Most tests=>16;
use Class::Load 'try_load_class';
BEGIN {
+
use_ok 'DBIx::Class::Migration';
use_ok 'DBIx::Class::Migration::SchemaLoader';
use_ok 'DBIx::Class::Migration::Script';
- use_ok 'DBIx::Class::Migration::Population';
use_ok 'DBIx::Class::Migration::SqliteSandbox';
use_ok 'Catalyst::TraitFor::Model::DBIC::Schema::FromMigration::_MigrationHelper';
use_ok 'Catalyst::TraitFor::Model::DBIC::Schema::FromMigration';
@@ -18,16 +18,20 @@ BEGIN {
use_ok 'DBIx::Class::Migration::RunScript';
SKIP: {
+ skip "Don't test population classes", 1
+ unless try_load_class('Test::DBIx::Class');
+ use_ok 'DBIx::Class::Migration::Population';
+ };
+
+ SKIP: {
skip "Don't test mysql classes", 1
unless try_load_class('Test::mysqld');
-
use_ok 'DBIx::Class::Migration::MySQLSandbox';
};
SKIP: {
skip "Don't test pg classes", 1
unless try_load_class('Test::postgresql');
-
use_ok 'DBIx::Class::Migration::PostgresqlSandbox';
};

0 comments on commit 2cab710

Please sign in to comment.