From e6ea9c3931636f5ebfb7877da18af28b221cdc58 Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Wed, 14 Jul 2010 15:30:39 -0700 Subject: Bug 578739: Instead of removing REFERENCES from _bz_real_schema and then populating FKs from _bz_schema at the end of checksetup, store REFERENCES in _bz_real_schema with a special "created => 0" key that tells us that we still need to create the FK. r=mkanat, a=mkanat (module owner) --- Bugzilla/DB/Mysql.pm | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'Bugzilla/DB/Mysql.pm') diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm index 66a261c75..699fcfdf6 100644 --- a/Bugzilla/DB/Mysql.pm +++ b/Bugzilla/DB/Mysql.pm @@ -721,7 +721,6 @@ EOT print "Converting table storage format to UTF-8. This may take a", " while.\n"; - my @dropped_fks; foreach my $table ($self->bz_table_list_real) { my $info_sth = $self->prepare("SHOW FULL COLUMNS FROM $table"); $info_sth->execute(); @@ -740,8 +739,9 @@ EOT print "$table.$name needs to be converted to UTF-8...\n"; - my $dropped = $self->bz_drop_related_fks($table, $name); - push(@dropped_fks, @$dropped); + # These will be automatically re-created at the end + # of checksetup. + $self->bz_drop_related_fks($table, $name); my $col_info = $self->bz_column_info_real($table, $name); @@ -792,10 +792,6 @@ EOT } } # foreach my $table (@tables) - - foreach my $fk_args (@dropped_fks) { - $self->bz_add_fk(@$fk_args); - } } # Sometimes you can have a situation where all the tables are utf8, -- cgit v1.2.3-24-g4f1b