From: Brandon Black Date: Thu, 20 Jul 2006 21:16:44 +0000 (+0000) Subject: bugfixes from nilsonsfj + 0.03005 release stuff X-Git-Tag: 0.03005 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8ac8926d0398647d4061a8c465ba48bb4351f722;p=dbsrgits%2FDBIx-Class-Schema-Loader.git bugfixes from nilsonsfj + 0.03005 release stuff --- diff --git a/Changes b/Changes index a08ec01..9ffc050 100644 --- a/Changes +++ b/Changes @@ -1,7 +1,14 @@ Revision history for Perl extension DBIx::Class::Schema::Loader +0.03005 Wed Jul 19 15:09:30 UTC 2006 + [ Pretty much everything in this release originates from nilsonsfj patches ] + - bugfix: mysql unique constraint code had an + obvious but longstanding error + - bugfix: columns were being specified out-of-order, + bug was introduced in the 0.03004 column metadata + dumping feature - dump code now skips+warns instead of dies when - dump_overwrite not set [from nilsonsfj] + dump_overwrite not set 0.03004 Tue Jul 11 04:38:09 UTC 2006 - make_schema_at efficiency improvements diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index dff4419..00c0c2b 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -493,11 +493,11 @@ sub _load_classes { $self->_dbic_stmt($table_class,'add_columns',@$cols); } else { - my %cols_hash; - foreach my $col (@$cols) { - $cols_hash{$col} = \%{($col_info->{$col})}; - } - $self->_dbic_stmt($table_class,'add_columns',%cols_hash); + $self->_dbic_stmt( + $table_class, + 'add_columns', + map { $_, $col_info->{$_} } @$cols + ); } my $pks = $self->_table_pk_info($table) || []; diff --git a/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm b/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm index 1ab0107..93fadad 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm @@ -97,7 +97,7 @@ sub _table_uniq_info { my @uniqs; my $keydata = $self->_mysql_table_get_keys($table); - foreach my $keyname (%$keydata) { + foreach my $keyname (keys %$keydata) { next if $keyname eq 'PRIMARY'; push(@uniqs, [ $keyname => $keydata->{$keyname} ]); } diff --git a/t/lib/dbixcsl_common_tests.pm b/t/lib/dbixcsl_common_tests.pm index db95bb2..3a86855 100644 --- a/t/lib/dbixcsl_common_tests.pm +++ b/t/lib/dbixcsl_common_tests.pm @@ -43,7 +43,7 @@ sub _monikerize { sub run_tests { my $self = shift; - plan tests => 73; + plan tests => 76; $self->create(); @@ -124,6 +124,11 @@ sub run_tests { isa_ok( $rsobj23, "DBIx::Class::ResultSet" ); isa_ok( $rsobj24, "DBIx::Class::ResultSet" ); + my @columns_lt2 = $class2->columns; + is($columns_lt2[0], 'id', "Column Ordering 0"); + is($columns_lt2[1], 'dat', "Column Ordering 1"); + is($columns_lt2[2], 'dat2', "Column Ordering 2"); + my %uniq1 = $class1->unique_constraints; my $uniq1_test = 0; foreach my $ucname (keys %uniq1) {