package SQL::Translator::Parser::YAML;
# -------------------------------------------------------------------
-# $Id: YAML.pm,v 1.3 2003-10-09 21:48:55 kycl4rk Exp $
+# $Id: YAML.pm,v 1.4 2004-01-25 18:10:55 kycl4rk Exp $
# -------------------------------------------------------------------
# Copyright (C) 2003 darren chamberlain <darren@cpan.org>,
# Ken Y. Clark <kclark@cpan.org>.
use strict;
use vars qw($VERSION);
-$VERSION = sprintf "%d.%02d", q$Revision: 1.3 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.4 $ =~ /(\d+)\.(\d+)/;
use SQL::Translator::Schema;
use SQL::Translator::Utils qw(header_comment);
$table->primary_key( $fdata->{'name'} )
if $fdata->{'is_primary_key'};
}
+
+ for my $idata ( @{ $tdata->{'indices'} || [] } ) {
+ $table->add_index( %$idata ) or die $table->error;
+ }
+
+ for my $cdata ( @{ $tdata->{'constraints'} || [] } ) {
+ $table->add_constraint( %$cdata ) or die $table->error;
+ }
}
#