diff --git a/docs/upgrades/upgrade_7.9.10-7.9.11.pl b/docs/upgrades/upgrade_7.9.10-7.9.11.pl index 806bee762..420d8274c 100644 --- a/docs/upgrades/upgrade_7.9.10-7.9.11.pl +++ b/docs/upgrades/upgrade_7.9.10-7.9.11.pl @@ -31,6 +31,7 @@ my $quiet; # this line required my $session = start(); # this line required # upgrade functions go here +alterStoryTopicTable($session); finish($session); # this line required @@ -44,6 +45,25 @@ finish($session); # this line required # print "DONE!\n" unless $quiet; #} +#---------------------------------------------------------------------------- +# Describe what our function does +sub alterStoryTopicTable { + my $session = shift; + print "\tAdd story sort order column to the StoryTopic table... " unless $quiet; + + my $sth = $session->db->read('DESCRIBE `StoryTopic`'); + while (my ($col) = $sth->array) { + if ($col eq 'storySortOrder') { + print "Skipped.\n" unless $quiet; + return; + } + } + + $session->db->write("ALTER TABLE StoryTopic ADD COLUMN storySortOrder CHAR(22)"); + $session->db->write("UPDATE StoryTopic SET storySortOrder = 'Chronologically' WHERE storySortOrder IS NULL"); + print "DONE!\n" unless $quiet; +} + # -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- diff --git a/docs/upgrades/upgrade_7.9.9-7.9.10.pl b/docs/upgrades/upgrade_7.9.9-7.9.10.pl index a9015b263..caa3a5daa 100644 --- a/docs/upgrades/upgrade_7.9.9-7.9.10.pl +++ b/docs/upgrades/upgrade_7.9.9-7.9.10.pl @@ -33,7 +33,6 @@ my $session = start(); # this line required # upgrade functions go here addSpamStopWordsToConfig($session); alterStoryArchiveTable($session); -alterStoryTopicTable($session); finish($session); # this line required @@ -75,25 +74,6 @@ sub alterStoryArchiveTable { print "DONE!\n" unless $quiet; } -#---------------------------------------------------------------------------- -# Describe what our function does -sub alterStoryTopicTable { - my $session = shift; - print "\tAdd story sort order column to the StoryTopic table... " unless $quiet; - - my $sth = $session->db->read('DESCRIBE `StoryTopic`'); - while (my ($col) = $sth->array) { - if ($col eq 'storySortOrder') { - print "Skipped.\n" unless $quiet; - return; - } - } - - $session->db->write("ALTER TABLE StoryTopic ADD COLUMN storySortOrder CHAR(22)"); - $session->db->write("UPDATE StoryTopic SET storySortOrder = 'Chronologically' WHERE storySortOrder IS NULL"); - print "DONE!\n" unless $quiet; -} - # -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- #----------------------------------------------------------------------------