From a58d109b017a1876b23c174775a8a432d82792b6 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Wed, 27 Sep 2006 22:54:11 +0000 Subject: [PATCH] fixed a problem with multistage upgrades and the search bug --- docs/upgrades/upgrade_7.0.6-7.0.7.pl | 8 -------- docs/upgrades/upgrade_7.0.7-7.0.8.pl | 8 ++++++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/docs/upgrades/upgrade_7.0.6-7.0.7.pl b/docs/upgrades/upgrade_7.0.6-7.0.7.pl index 03b516856..de080e8f0 100644 --- a/docs/upgrades/upgrade_7.0.6-7.0.7.pl +++ b/docs/upgrades/upgrade_7.0.6-7.0.7.pl @@ -21,7 +21,6 @@ my $quiet; # this line required my $session = start(); # this line required # upgrade functions go here -dropLineageInAssetIndex($session); giveTasksMultipleResources($session); giveTasksLagTime($session); giveProjectsObserverGroup($session); @@ -29,13 +28,6 @@ giveProjectsObserverGroup($session); finish($session); # this line required -#------------------------------------------------- -sub dropLineageInAssetIndex { - my $session = shift; - print "\tDropping lineage column in assetIndex table.\n" unless ($quiet); - - $session->db->write('alter table assetIndex drop column lineage'); -} sub giveTasksMultipleResources { my $session = shift; diff --git a/docs/upgrades/upgrade_7.0.7-7.0.8.pl b/docs/upgrades/upgrade_7.0.7-7.0.8.pl index 42ddde6d2..7dea9bb01 100644 --- a/docs/upgrades/upgrade_7.0.7-7.0.8.pl +++ b/docs/upgrades/upgrade_7.0.7-7.0.8.pl @@ -30,8 +30,12 @@ finish($session); # this line required #------------------------------------------------- sub fixSearch { print "\tFixing search.\n" unless ($quiet); - $session->db->write("alter table assetIndex add column lineage varchar(255)"); - + my $sth = $session->db->read("describe assetIndex lineage"); + my $exists = $sth->rows; + $sth->finish; + unless ($exists) { + $session->db->write("alter table assetIndex add column lineage varchar(255)"); + } } #-------------------------------------------------