summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB.pm
diff options
context:
space:
mode:
authorStephanie Daugherty <sdaugherty@gmail.com>2011-08-29 23:30:15 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2011-08-29 23:30:15 +0200
commit2054799e43e2437b94f2d86981d21ec786d12a70 (patch)
tree87ceaf603e2ea66ebd16dd6b6092d542a0579f20 /Bugzilla/DB.pm
parent9cfecf559d27fe2a29cd3e8d246e069fd30601a9 (diff)
downloadbugzilla-2054799e43e2437b94f2d86981d21ec786d12a70.tar.gz
bugzilla-2054799e43e2437b94f2d86981d21ec786d12a70.tar.xz
Bug 637648 - Rename the "tags" table to "tag"
r=LpSolit, a=LpSolit
Diffstat (limited to 'Bugzilla/DB.pm')
-rw-r--r--Bugzilla/DB.pm14
1 files changed, 11 insertions, 3 deletions
diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm
index 8d1cf32a0..a537d6131 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);