From 5cb3a6e005cfc1423bff5b7d1687728a4635ac9f Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Tue, 8 Sep 2009 18:04:41 -0700 Subject: [PATCH] Add default values to the Matrix to newly added columns. bug #10889 --- docs/upgrades/upgrade_7.7.19-7.8.0.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/upgrades/upgrade_7.7.19-7.8.0.pl b/docs/upgrades/upgrade_7.7.19-7.8.0.pl index 37d6204b4..f16cdd794 100644 --- a/docs/upgrades/upgrade_7.7.19-7.8.0.pl +++ b/docs/upgrades/upgrade_7.7.19-7.8.0.pl @@ -33,6 +33,7 @@ my $session = start(); # this line required # upgrade functions go here reorganizeAdSpaceProperties($session); fixTemplateSettingsFromShunt($session); +addMatrixColumnDefaults($session); finish($session); # this line required @@ -58,6 +59,18 @@ sub reorganizeAdSpaceProperties { print "DONE!\n" unless $quiet; } +#---------------------------------------------------------------------------- +# Describe what our function does +sub addMatrixColumnDefaults { + my $session = shift; + print "\tUpdate existing Matrixes with default values for maxComparisons... " unless $quiet; + $session->db->write(q|UPDATE Matrix set maxComparisons=25 where maxComparisons IS NULL|); + $session->db->write(q|UPDATE Matrix set maxComparisonsGroup=25 where maxComparisonsGroup IS NULL|); + $session->db->write(q|UPDATE Matrix set maxComparisonsPrivileged=25 where maxComparisonsPrivileged IS NULL|); + # and here's our code + print "DONE!\n" unless $quiet; +} + sub fixTemplateSettingsFromShunt { my $session = shift; print "\tClear isPackage and set isDefault on recently imported templates... " unless $quiet;