package SQL::Translator::Parser::Oracle;
# -------------------------------------------------------------------
-# $Id: Oracle.pm,v 1.19 2004-09-17 21:52:46 kycl4rk Exp $
+# $Id: Oracle.pm,v 1.20 2005-06-28 16:39:41 mwz444 Exp $
# -------------------------------------------------------------------
# Copyright (C) 2002-4 SQLFairy Authors
#
use strict;
use vars qw[ $DEBUG $VERSION $GRAMMAR @EXPORT_OK ];
-$VERSION = sprintf "%d.%02d", q$Revision: 1.19 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.20 $ =~ /(\d+)\.(\d+)/;
$DEBUG = 0 unless defined $DEBUG;
use Data::Dumper;
reference_table => $desc->{'reference_table'},
reference_fields => $desc->{'reference_fields'},
# match_type => $desc->{'match_type'},
-# on_update_do => $desc->{'on_update_do'},
+# on_update => $desc->{'on_update'},
}
}
{ $return = { type => 'primary_key' } }
| /check/i '(' /[^)]+/ ')'
{ $return = { type => 'check', expression => $item[3] } }
- | /references/i table_name parens_word_list(?) on_delete_do(?)
+ | /references/i table_name parens_word_list(?) on_delete(?)
{
$return = {
type => 'foreign_key',
reference_table => $item[2],
reference_fields => $item[3][0],
# match_type => $item[4][0],
- on_delete_do => $item[5][0],
+ on_delete => $item[5][0],
}
}
reference_table => $desc->{'reference_table'},
reference_fields => $desc->{'reference_fields'},
# match_type => $desc->{'match_type'}[0],
- on_delete_do => $desc->{'on_delete_do'},
- on_update_do => $desc->{'on_update_do'},
+ on_delete => $desc->{'on_delete'} || $desc->{'on_delete_do'},
+ on_update => $desc->{'on_update'} || $desc->{'on_update_do'},
comments => [ @comments ],
}
}
}
}
|
- /foreign key/i '(' NAME(s /,/) ')' /references/i table_name parens_word_list(?) on_delete_do(?)
+ /foreign key/i '(' NAME(s /,/) ')' /references/i table_name parens_word_list(?) on_delete(?)
{
$return = {
type => 'foreign_key',
reference_table => $item[6],
reference_fields => $item[7][0],
match_type => $item[8][0],
- on_delete_do => $item[9][0],
- on_update_do => $item[10][0],
+ on_delete => $item[9][0],
+ on_update => $item[10][0],
}
}
-on_delete_do : /on delete/i WORD(s)
+on_delete : /on delete/i WORD(s)
{ $item[2] }
UNIQUE : /unique/i { $return = 1 }
reference_table => $cdata->{'reference_table'},
reference_fields => $cdata->{'reference_fields'},
match_type => $cdata->{'match_type'} || '',
- on_delete => $cdata->{'on_delete_do'},
- on_update => $cdata->{'on_update_do'},
+ on_delete => $cdata->{'on_delete'} || $cdata->{'on_delete_do'},
+ on_update => $cdata->{'on_update'} || $cdata->{'on_update_do'},
) or die $table->error;
}
}