summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB.pm
diff options
context:
space:
mode:
authorStephanie Daugherty <sdaugherty@gmail.com>2011-08-29 23:29:30 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2011-08-29 23:29:30 +0200
commit8e5e72fccecb5ad778188d0d3a807cc5c0c0ac7c (patch)
tree0a846f335e338fcb7a38db932e3217095d9f03c9 /Bugzilla/DB.pm
parentdd0e1c27011f13edc0083078ebef7d061822cff7 (diff)
downloadbugzilla-8e5e72fccecb5ad778188d0d3a807cc5c0c0ac7c.tar.gz
bugzilla-8e5e72fccecb5ad778188d0d3a807cc5c0c0ac7c.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 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);