From: Ken Youens-Clark Date: Thu, 21 Aug 2003 20:27:04 +0000 (+0000) Subject: Fixed problem with "deep recursion." X-Git-Tag: v0.04~241 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2ccf22994683b122ec5082bf1f90806520f7be85;p=dbsrgits%2FSQL-Translator.git Fixed problem with "deep recursion." --- diff --git a/lib/SQL/Translator/Schema/Table.pm b/lib/SQL/Translator/Schema/Table.pm index e9efc88..878debe 100644 --- a/lib/SQL/Translator/Schema/Table.pm +++ b/lib/SQL/Translator/Schema/Table.pm @@ -1,7 +1,7 @@ package SQL::Translator::Schema::Table; # ---------------------------------------------------------------------- -# $Id: Table.pm,v 1.13 2003-08-21 18:10:47 kycl4rk Exp $ +# $Id: Table.pm,v 1.14 2003-08-21 20:27:04 kycl4rk Exp $ # ---------------------------------------------------------------------- # Copyright (C) 2003 Ken Y. Clark # @@ -50,7 +50,7 @@ use SQL::Translator::Schema::Index; use base 'Class::Base'; use vars qw( $VERSION $FIELD_ORDER ); -$VERSION = sprintf "%d.%02d", q$Revision: 1.13 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.14 $ =~ /(\d+)\.(\d+)/; # ---------------------------------------------------------------------- sub init { @@ -125,6 +125,13 @@ C object. $constraint = $pk; $ok = 0; } + elsif ( $constraint->type eq PRIMARY_KEY ) { + for my $fname ( $constraint->fields ) { + if ( my $f = $self->get_field( $fname ) ) { + $f->is_primary_key( 1 ); + } + } + } # # See if another constraint of the same type # covers the same fields.