re-adding the upgrade stuff for wiki attachments
This commit is contained in:
parent
a9f45865e6
commit
13a50c74c8
1 changed files with 19 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ use strict;
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
use WebGUI::Session;
|
use WebGUI::Session;
|
||||||
use WebGUI::Workflow;
|
use WebGUI::Workflow;
|
||||||
|
use WebGUI::Storage;
|
||||||
|
|
||||||
my $toVersion = "7.4.0"; # make this match what version you're going to
|
my $toVersion = "7.4.0"; # make this match what version you're going to
|
||||||
my $quiet; # this line required
|
my $quiet; # this line required
|
||||||
|
|
@ -34,11 +35,29 @@ addHttpProxyUrlPatternFilter($session);
|
||||||
addCanStartThreadToCS($session);
|
addCanStartThreadToCS($session);
|
||||||
addPostCaptchaToCS($session);
|
addPostCaptchaToCS($session);
|
||||||
addFieldsToDatabaseLinks($session);
|
addFieldsToDatabaseLinks($session);
|
||||||
|
addWikiAttachments($session);
|
||||||
|
|
||||||
finish($session); # this line required
|
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 {
|
sub addFieldsToDatabaseLinks {
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
print "\tAdding new fields to Database Links...\n" unless ($quiet);
|
print "\tAdding new fields to Database Links...\n" unless ($quiet);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue