From efc30f6fcb493580d3c4e9860446842d01c1dab9 Mon Sep 17 00:00:00 2001 From: Matthew Wilson Date: Thu, 23 Mar 2006 19:08:43 +0000 Subject: [PATCH] only add new disableRichEdit field if it's not already there. --- docs/upgrades/upgrade_6.8.7-6.99.0.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/upgrades/upgrade_6.8.7-6.99.0.pl b/docs/upgrades/upgrade_6.8.7-6.99.0.pl index 9ebfac82e..5489fd35d 100644 --- a/docs/upgrades/upgrade_6.8.7-6.99.0.pl +++ b/docs/upgrades/upgrade_6.8.7-6.99.0.pl @@ -755,7 +755,11 @@ sub removeFiles { #------------------------------------------------- sub addDisabletoRichEditor { print "\tUpdating Rich Editor to add master disable.\n" unless ($quiet); - $session->db->write("alter table RichEdit add column disableRichEditor int(11) default '0'"); + my $sth = $session->db->read('show columns from RichEdit'); + my $numColumns = $sth->rows; + $sth->finish; + # only add the column if it doesn't already exist. + $session->db->write("alter table RichEdit add column disableRichEditor int(11) default 0") if ($numColumns < 21); } #-------------------------------------------------