via alter_field to a column in Postgres Producer
* added a working mechanism for naming foreign keys in the PostgreSQL producer
* Fix possible name duplication in SQLlite producer
+* Oracle does not accept ON DELETE/UPDATE RESTRICT (though it is the actual default)
+ fix by not adding the ON DELETE/UPDATE clause at all
# ----------------------------------------------------------
# 0.11010 2011-10-05
elsif ( $c->type eq FOREIGN_KEY ) {
$name = mk_name( join('_', $table_name, $c->fields). '_fk' );
$name = quote($name, $qf);
+ my $on_delete = uc ($c->on_delete || '');
+
my $def = "CONSTRAINT $name FOREIGN KEY ";
if ( @fields ) {
( $c->match_type =~ /full/i ) ? 'FULL' : 'PARTIAL';
}
- if ( $c->on_delete ) {
+ if ( $on_delete && $on_delete ne "RESTRICT") {
$def .= ' ON DELETE '.$c->on_delete;
}