add support for Foreign keys in Schema

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7127 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2010-08-18 15:06:17 +00:00
parent 752cbd0f1a
commit 34a349cae0

View File

@ -456,6 +456,16 @@ sub buildcreatestmt
}
$retv .= ",\n ";
}
# if there are foreign keys
my $fkey=$descr->{foreignkeys};
if ($fkey) {
$retv .= "FOREIGN KEY ";
$retv .= $fkey;
$retv .= ",\n ";
}
if ($retv =~ /PRIMARY KEY/) {
$retv =~ s/,\n $/\n)/;
} else {
@ -471,9 +481,7 @@ sub buildcreatestmt
}
$retv =~ s/,$/)\n)/;
}
#if ($xcatcfg =~ /^DB2:/) { # for DB2 add tablespace
# $retv .= " IN XCATTBS16K";
#}
$retv =~ s/,$/)\n)/;
#print "retv=$retv\n";
return $retv;
}