diff options
author | 2011-08-29 14:29:30 -0700 | |
---|---|---|
committer | 2011-08-29 14:29:30 -0700 | |
commit | 8e5e72fccecb5ad778188d0d3a807cc5c0c0ac7c (patch) | |
tree | 0a846f335e338fcb7a38db932e3217095d9f03c9 /Bugzilla/DB.pm | |
parent | Bug 680594: Remove contrib/yp_nomail.sh (diff) | |
download | bugzilla-8e5e72fccecb5ad778188d0d3a807cc5c0c0ac7c.tar.gz bugzilla-8e5e72fccecb5ad778188d0d3a807cc5c0c0ac7c.tar.bz2 bugzilla-8e5e72fccecb5ad778188d0d3a807cc5c0c0ac7c.zip |
Bug 637648 - Rename the "tags" table to "tag"
r=LpSolit, a=LpSolit
Diffstat (limited to 'Bugzilla/DB.pm')
-rw-r--r-- | Bugzilla/DB.pm | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm index 3c37c0dbd..ccd86d781 100644 --- a/Bugzilla/DB.pm +++ b/Bugzilla/DB.pm @@ -93,6 +93,12 @@ use constant FULLTEXT_OR => ''; use constant WORD_START => '(^|[^[:alnum:]])'; use constant WORD_END => '($|[^[:alnum:]])'; +# On most databases, in order to drop an index, you have to first drop +# the foreign keys that use that index. However, on some databases, +# dropping the FK immediately before dropping the index causes problems +# and doesn't need to be done anyway, so those DBs set this to 0. +use constant INDEX_DROPS_REQUIRE_FK_DROPS => 1; + ##################################################################### # Overridden Superclass Methods ##################################################################### @@ -947,9 +953,11 @@ sub bz_drop_index { my $index_exists = $self->bz_index_info($table, $name); if ($index_exists) { - # We cannot delete an index used by a FK. - foreach my $column (@{$index_exists->{FIELDS}}) { - $self->bz_drop_related_fks($table, $column); + if ($self->INDEX_DROPS_REQUIRE_FK_DROPS) { + # We cannot delete an index used by a FK. + foreach my $column (@{$index_exists->{FIELDS}}) { + $self->bz_drop_related_fks($table, $column); + } } $self->bz_drop_index_raw($table, $name); $self->_bz_real_schema->delete_index($table, $name); |