From: Ivan Kohler Date: Sat, 16 Nov 2013 01:52:27 +0000 (-0800) Subject: Fix MATCH / ON DELETE / ON UPDATE X-Git-Url: http://git.freeside.biz/gitweb/?p=DBIx-DBSchema.git;a=commitdiff_plain;h=76a7c156bcd8546ca2ed70b6ec78dbf432993895 Fix MATCH / ON DELETE / ON UPDATE --- diff --git a/Changes b/Changes index cb1af01..953ba29 100644 --- a/Changes +++ b/Changes @@ -1,10 +1,11 @@ Revision history for Perl module DBIx::DBSchema -0.44_01 not released +0.44_02 not released - POD fixes from Xavier Guimard and Damyan Ivanov of the Debian Perl Group, closes: CPAN#82187 - More foreign key support - + table alteration (removing foreign keys) + + Table alteration (removing foreign keys) + + Fix MATCH / ON DELETE / ON UPDATE 0.43 2013-11-04 14:58;32 PST - Incorporate CPAN::Changes::Spec-compliant Changes file from Neil Bowers diff --git a/DBSchema/ForeignKey.pm b/DBSchema/ForeignKey.pm index 8be4032..bd48229 100644 --- a/DBSchema/ForeignKey.pm +++ b/DBSchema/ForeignKey.pm @@ -2,7 +2,7 @@ package DBIx::DBSchema::ForeignKey; use strict; -our $VERSION = '0.12'; +our $VERSION = '0.13'; our $DEBUG = 0; =head1 NAME @@ -217,7 +217,10 @@ sub sql_foreign_key { my $ref_sql = $self->references_sql; "FOREIGN KEY ( $col_sql ) REFERENCES $table ( $ref_sql ) ". - join ' ', grep $_, map $self->$_, qw( match on_delete on_update ); + join ' ', map { (my $thing_sql = uc($_) ) =~ s/_/ /g; + "$thing_sql ". $self->$_; + } + grep $self->$_, qw( match on_delete on_update ); } =item cmp OTHER_INDEX_OBJECT diff --git a/DBSchema/Table.pm b/DBSchema/Table.pm index 9d85947..ef51928 100644 --- a/DBSchema/Table.pm +++ b/DBSchema/Table.pm @@ -5,7 +5,7 @@ use Carp; use DBIx::DBSchema::_util qw(_load_driver _dbh _parse_opt); use DBIx::DBSchema::Column 0.14; use DBIx::DBSchema::Index; -use DBIx::DBSchema::ForeignKey 0.12; +use DBIx::DBSchema::ForeignKey 0.13; our $VERSION = '0.11'; our $DEBUG = 0;