diff --git a/docs/upgrades/upgrade_7.3.22-7.4.0.pl b/docs/upgrades/upgrade_7.3.22-7.4.0.pl index 3e69036a5..6df34f852 100644 --- a/docs/upgrades/upgrade_7.3.22-7.4.0.pl +++ b/docs/upgrades/upgrade_7.3.22-7.4.0.pl @@ -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);