re-adding the upgrade stuff for wiki attachments

This commit is contained in:
JT Smith 2007-07-26 01:15:14 +00:00
parent a9f45865e6
commit 13a50c74c8

View file

@ -13,6 +13,7 @@ use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::Workflow;
use WebGUI::Storage;
my $toVersion = "7.4.0"; # make this match what version you're going to
my $quiet; # this line required
@ -34,11 +35,29 @@ addHttpProxyUrlPatternFilter($session);
addCanStartThreadToCS($session);
addPostCaptchaToCS($session);
addFieldsToDatabaseLinks($session);
addWikiAttachments($session);
finish($session); # this line required
#-------------------------------------------------
sub addWikiAttachments {
my $session = shift;
print "\tAdding support for attachmetns to wikis.\n" unless ($quiet);
my $db = $session->db;
$db->write("alter table WikiMaster add column allowAttachments int not null default 0");
my $sth = $db->read("select storageId from WikiPage");
while (my ($id) = $sth->array) {
my $storage = WebGUI::Storage->get($session, $id);
if (defined $storage) {
$storage->delete;
}
}
$db->write("alter table WikiPage drop column storageId");
}
#-------------------------------------------------
sub addFieldsToDatabaseLinks {
my $session = shift;
print "\tAdding new fields to Database Links...\n" unless ($quiet);