summaryrefslogtreecommitdiffstats
path: root/checksetup.pl
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-04-15 01:50:39 +0200
committerlpsolit%gmail.com <>2006-04-15 01:50:39 +0200
commit344149d0e639267412ca0e2ccd95c2872e9350d9 (patch)
tree27b64e7e1c6e35367803bce5a35f7addfc1337c6 /checksetup.pl
parentbd0e09be136d808154320d61bf2725e2324c2243 (diff)
downloadbugzilla-344149d0e639267412ca0e2ccd95c2872e9350d9.tar.gz
bugzilla-344149d0e639267412ca0e2ccd95c2872e9350d9.tar.xz
Bug 322285: Cancelling a flag should remove it completely from the DB - Patch by Frédéric Buclin <LpSolit@gmail.com> r/a=myk
Diffstat (limited to 'checksetup.pl')
-rwxr-xr-xchecksetup.pl22
1 files changed, 16 insertions, 6 deletions
diff --git a/checksetup.pl b/checksetup.pl
index ab847674b..d572c2bf3 100755
--- a/checksetup.pl
+++ b/checksetup.pl
@@ -3621,12 +3621,6 @@ if ($dbh->bz_column_info("user_group_map", "isderived")) {
$dbh->do("UPDATE groups SET last_changed = NOW() WHERE name = 'admin'");
}
-# 2004-07-03 - Make it possible to disable flags without deleting them
-# from the database. Bug 223878, jouni@heikniemi.net
-
-$dbh->bz_add_column('flags', 'is_active',
- {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 'TRUE'});
-
# 2004-07-16 - Make it possible to have group-group relationships other than
# membership and bless.
if ($dbh->bz_column_info("group_group_map", "isbless")) {
@@ -4283,6 +4277,22 @@ $dbh->bz_add_column('fielddefs', 'custom',
$dbh->bz_add_column('longdescs', 'comment_id',
{TYPE => 'MEDIUMSERIAL', NOTNULL => 1, PRIMARYKEY => 1});
+# 2006-03-02 LpSolit@gmail.com - Bug 322285
+# Do not store inactive flags in the DB anymore.
+if ($dbh->bz_column_info('flags', 'id')->{'TYPE'} eq 'INT3') {
+ # We first have to remove all existing inactive flags.
+ if ($dbh->bz_column_info('flags', 'is_active')) {
+ $dbh->do('DELETE FROM flags WHERE is_active = 0');
+ }
+
+ # Now we convert the id column to the auto_increment format.
+ $dbh->bz_alter_column('flags', 'id',
+ {TYPE => 'MEDIUMSERIAL', NOTNULL => 1, PRIMARYKEY => 1});
+
+ # And finally, we remove the is_active column.
+ $dbh->bz_drop_column('flags', 'is_active');
+}
+
# If you had to change the --TABLE-- definition in any way, then add your
# differential change code *** A B O V E *** this comment.
#