From 40a199771b751ebf7378efe32a68584ad7570ee7 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Sun, 11 Mar 2007 00:21:19 +0000 Subject: Bug 373442: Add referential integrity against the profiles table in some more simple places Patch By Max Kanat-Alexander (module owner) a=mkanat --- Bugzilla/DB/Schema/Mysql.pm | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'Bugzilla/DB/Schema') diff --git a/Bugzilla/DB/Schema/Mysql.pm b/Bugzilla/DB/Schema/Mysql.pm index eb7cd3c87..c867dc0fc 100644 --- a/Bugzilla/DB/Schema/Mysql.pm +++ b/Bugzilla/DB/Schema/Mysql.pm @@ -176,17 +176,10 @@ sub get_alter_column_ddl { # keys are not allowed. delete $new_def_copy{PRIMARYKEY}; } - # CHANGE COLUMN doesn't support REFERENCES - delete $new_def_copy{REFERENCES}; my $new_ddl = $self->get_type_ddl(\%new_def_copy); my @statements; - # Drop the FK if the new definition doesn't have one. - if ($old_def->{REFERENCES} && !$new_def->{REFERENCES}) { - push(@statements, $self->_get_drop_fk_sql($table, $column, $old_def)); - } - push(@statements, "UPDATE $table SET $column = $set_nulls_to WHERE $column IS NULL") if defined $set_nulls_to; push(@statements, "ALTER TABLE $table CHANGE COLUMN @@ -196,10 +189,6 @@ sub get_alter_column_ddl { push(@statements, "ALTER TABLE $table DROP PRIMARY KEY"); } - # Add the FK if the new definition has one and the old definition doesn't. - if ($new_def->{REFERENCES} && !$old_def->{REFERENCES}) { - push(@statements, $self->_get_add_fk_sql($table, $column, $new_def)); - } return @statements; } -- cgit v1.2.3-24-g4f1b