From: Brandon Black Date: Tue, 7 Feb 2006 03:57:10 +0000 (+0000) Subject: same mysql fix as DBIx::Class::Loader, changes/version update for 0.01004 X-Git-Tag: 0.03000~22 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=738705c6bb0694340d843228ed463031e266b758;p=dbsrgits%2FDBIx-Class-Schema-Loader.git same mysql fix as DBIx::Class::Loader, changes/version update for 0.01004 --- diff --git a/Changes b/Changes index 5280932..d866f40 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,9 @@ Revision history for Perl extension DBIx::Class::Schema::Loader +0.01004 Tue Feb 7 03:58:01 UTC 2006 + - No longer tries to parse out the table name from the dsn for mysql, + was unneccesary vestigial code from previous method. + 0.01003 Mon Feb 6 14:57:56 UTC 2006 - Fixed the has_many side of _make_cond_rel diff --git a/META.yml b/META.yml index 2d202fd..6137726 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- name: DBIx-Class-Schema-Loader -version: 0.01002 +version: 0.01004 author: - 'Brandon Black, C' abstract: Dynamic definition of a DBIx::Class::Schema @@ -20,7 +20,7 @@ build_requires: provides: DBIx::Class::Schema::Loader: file: lib/DBIx/Class/Schema/Loader.pm - version: 0.01003 + version: 0.01004 DBIx::Class::Schema::Loader::DB2: file: lib/DBIx/Class/Schema/Loader/DB2.pm DBIx::Class::Schema::Loader::Generic: diff --git a/lib/DBIx/Class/Schema/Loader.pm b/lib/DBIx/Class/Schema/Loader.pm index 8d83679..a9a4b35 100644 --- a/lib/DBIx/Class/Schema/Loader.pm +++ b/lib/DBIx/Class/Schema/Loader.pm @@ -10,7 +10,7 @@ use UNIVERSAL::require; # Always remember to do all digits for the version even if they're 0 # i.e. first release of 0.XX *must* be 0.XX000. This avoids fBSD ports # brain damage and presumably various other packaging systems too -our $VERSION = '0.01003'; +our $VERSION = '0.01004'; __PACKAGE__->mk_classaccessor('loader'); diff --git a/lib/DBIx/Class/Schema/Loader/mysql.pm b/lib/DBIx/Class/Schema/Loader/mysql.pm index b3aaafd..97fceaa 100644 --- a/lib/DBIx/Class/Schema/Loader/mysql.pm +++ b/lib/DBIx/Class/Schema/Loader/mysql.pm @@ -36,19 +36,11 @@ sub _load_relationships { my $self = shift; my @tables = $self->tables; my $dbh = $self->schema->storage->dbh; - my $dsn = $self->dsn; - my %conn = - $dsn =~ m/\Adbi:\w+(?:\(.*?\))?:(.+)\z/i - && index( $1, '=' ) >= 0 - ? split( /[=;]/, $1 ) - : ( database => $1 ); - my $dbname = $conn{database} || $conn{dbname} || $conn{db}; - die("Can't figure out the table name automatically.") if !$dbname; my $quoter = $dbh->get_info(29) || q{`}; foreach my $table (@tables) { - my $query = "SHOW CREATE TABLE ${dbname}.${table}"; + my $query = "SHOW CREATE TABLE ${table}"; my $sth = $dbh->prepare($query) or die("Cannot get table definition: $table"); $sth->execute;