Commit 2c536d9c authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 486239: [Oracle] Missing keyword RESTRICT on fk creation (DB::Schema…

Bug 486239: [Oracle] Missing keyword RESTRICT on fk creation (DB::Schema explicitly specified DELETE => 'RESTRICT') Patch by Xiaoou Wu <xiaoou.wu@oracle.com> and Max Kanat-Alexander <mkanat@bugzilla.org> r=mkanat
parent f9a7938b
......@@ -381,8 +381,7 @@ use constant ABSTRACT_SCHEMA => {
DELETE => 'CASCADE'}},
who => {TYPE => 'INT3', NOTNULL => 1,
REFERENCES => {TABLE => 'profiles',
COLUMN => 'userid',
DELETE => 'RESTRICT'}},
COLUMN => 'userid'}},
bug_when => {TYPE => 'DATETIME', NOTNULL => 1},
work_time => {TYPE => 'decimal(5,2)', NOTNULL => 1,
DEFAULT => '0'},
......
......@@ -145,6 +145,9 @@ sub get_fk_ddl {
my $to_column = $references->{COLUMN} || confess "No column in reference";
my $fk_name = $self->_get_fk_name($table, $column, $references);
# 'ON DELETE RESTRICT' is enabled by default
$delete = "" if ($delete =~ /RESTRICT/i);
my $fk_string = "\n CONSTRAINT $fk_name FOREIGN KEY ($column)\n"
. " REFERENCES $to_table($to_column)\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment