From: Ken Youens-Clark Date: Thu, 9 Oct 2003 21:48:55 +0000 (+0000) Subject: Fix PK info if available. X-Git-Tag: v0.04~93 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=46a063501073ea2469bcd204c68c6a546974df13;p=dbsrgits%2FSQL-Translator.git Fix PK info if available. --- diff --git a/lib/SQL/Translator/Parser/YAML.pm b/lib/SQL/Translator/Parser/YAML.pm index f00b8d3..e0ee2ea 100644 --- a/lib/SQL/Translator/Parser/YAML.pm +++ b/lib/SQL/Translator/Parser/YAML.pm @@ -1,7 +1,7 @@ package SQL::Translator::Parser::YAML; # ------------------------------------------------------------------- -# $Id: YAML.pm,v 1.2 2003-10-08 22:44:52 kycl4rk Exp $ +# $Id: YAML.pm,v 1.3 2003-10-09 21:48:55 kycl4rk Exp $ # ------------------------------------------------------------------- # Copyright (C) 2003 darren chamberlain , # Ken Y. Clark . @@ -23,7 +23,7 @@ package SQL::Translator::Parser::YAML; use strict; use vars qw($VERSION); -$VERSION = sprintf "%d.%02d", q$Revision: 1.2 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.3 $ =~ /(\d+)\.(\d+)/; use SQL::Translator::Schema; use SQL::Translator::Utils qw(header_comment); @@ -63,6 +63,8 @@ sub parse { for my $fdata ( @fields ) { $table->add_field( %$fdata ) or die $table->error; + $table->primary_key( $fdata->{'name'} ) + if $fdata->{'is_primary_key'}; } }