summaryrefslogtreecommitdiffstats
path: root/checksetup.pl
diff options
context:
space:
mode:
authorgerv%gerv.net <>2002-07-25 08:22:55 +0200
committergerv%gerv.net <>2002-07-25 08:22:55 +0200
commitf71149e1af4ac0b03678fc80da73a7cdc352c3aa (patch)
treee2bdebeb1b6a27171fc22b14fd5b4f9412052c3e /checksetup.pl
parent8685e9a274f0b6d88d0b3447662ff8db9564c8a9 (diff)
downloadbugzilla-f71149e1af4ac0b03678fc80da73a7cdc352c3aa.tar.gz
bugzilla-f71149e1af4ac0b03678fc80da73a7cdc352c3aa.tar.xz
Bug 67950 - Move the quip list into the database. Patch by davef@tetsubo.com; r=gerv, preed.
Diffstat (limited to 'checksetup.pl')
-rwxr-xr-xchecksetup.pl34
1 files changed, 34 insertions, 0 deletions
diff --git a/checksetup.pl b/checksetup.pl
index 6013bd1d5..5b504dea9 100755
--- a/checksetup.pl
+++ b/checksetup.pl
@@ -1589,6 +1589,12 @@ $table{tokens} =
index(userid)';
+# 2002-07-19, davef@tetsubo.com, bug 67950:
+# Store quips in the db.
+$table{quips} =
+ 'quipid mediumint not null auto_increment primary key,
+ userid mediumint not null default 0,
+ quip text not null';
###########################################################################
@@ -3015,6 +3021,34 @@ if (!GetFieldDef("bugs", "alias")) {
$dbh->do("ALTER TABLE bugs ADD UNIQUE (alias)");
}
+# 2002-07-15 davef@tetsubo.com - bug 67950
+# Move quips to the db.
+my $renamed_comments_file = 0;
+if (GetFieldDef("quips", "quipid")) {
+ if (-s 'data/comments' && open (COMMENTS, "<data/comments")) {
+ print "Populating quips table from data/comments...\n";
+ while (<COMMENTS>) {
+ chomp;
+ $dbh->do("INSERT INTO quips (quip) VALUES ("
+ . $dbh->quote($_) . ")");
+ }
+ print "The data/comments file (used to store quips) has been
+copied into the database, and the data/comments file
+moved to data/comments.bak - you can delete this file
+once you're satisfied the migration worked correctly.\n";
+ close COMMENTS;
+ rename("data/comments", "data/comments.bak") or next;
+ $renamed_comments_file = 1;
+ }
+}
+
+# Warn if data/comments.bak exists, as it should be deleted.
+if (-s 'data/comments.bak' && !$renamed_comments_file) {
+ print "Please note the data/comments.bak file can be removed as it's
+no longer used.\n";
+}
+
+
# If you had to change the --TABLE-- definition in any way, then add your
# differential change code *** A B O V E *** this comment.
#