X-Git-Url: http://git.pippins.net/embedvideo/.git/static/gitweb.js?a=blobdiff_plain;f=bin%2Fupgrade_1_1_0_to_1_1_1;h=942472891d7a918a93bb0a983ab7bf432fbcc481;hb=6164e3a3c2d19b4e1d718ccafd7dddf6da27d270;hp=904133d92afd622feaabd529268be7abff6a338d;hpb=40bab501e1ba7d982bead980469dcd975d141130;p=eq%2F.git diff --git a/bin/upgrade_1_1_0_to_1_1_1 b/bin/upgrade_1_1_0_to_1_1_1 index 904133d..9424728 100755 --- a/bin/upgrade_1_1_0_to_1_1_1 +++ b/bin/upgrade_1_1_0_to_1_1_1 @@ -26,6 +26,28 @@ $sth->execute or die "-E- DB error: $DBI::errstr\n"; $sth = $dbh->prepare("ALTER TABLE `tc_interview` DROP `interview_type` "); $sth->execute or die "-E- DB error: $DBI::errstr\n"; +# Change visit_type field in tc_visit table to type, change enum to use 'H','P' +$sth = $dbh->prepare("ALTER TABLE `tc_visit` ADD `type` ENUM( 'H', 'P' ) NOT NULL AFTER `visit_type`"); +$sth->execute or die "-E- DB error: $DBI::errstr\n"; +$sth = $dbh->prepare("UPDATE tc_visit SET type='H' WHERE visit_type='hometeaching'"); +$sth->execute or die "-E- DB error: $DBI::errstr\n"; +$sth = $dbh->prepare("UPDATE tc_visit SET type='P' WHERE visit_type='presidency'"); +$sth->execute or die "-E- DB error: $DBI::errstr\n"; +$sth = $dbh->prepare("ALTER TABLE `tc_visit` DROP `visit_type` "); +$sth->execute or die "-E- DB error: $DBI::errstr\n"; + +# add type field to tc_companionship +$sth = $dbh->prepare("ALTER TABLE `tc_companionship` ADD `type` ENUM( 'H', 'P' ) NOT NULL DEFAULT 'H' AFTER `district`"); +$sth->execute or die "-E- DB error: $DBI::errstr\n"; + +# rename supervisor field in tc_district to leader +$sth = $dbh->prepare("ALTER TABLE `tc_district` CHANGE `supervisor` `leader` INT( 16 ) UNSIGNED NULL DEFAULT NULL"); +$sth->execute or die "-E- DB error: $DBI::errstr\n"; + +# rename supervisor field in tc_district_sandbox to leader +$sth = $dbh->prepare("ALTER TABLE `tc_district_sandbox` CHANGE `supervisor` `leader` INT( 16 ) UNSIGNED NULL DEFAULT NULL"); +$sth->execute or die "-E- DB error: $DBI::errstr\n"; + print "-> Done!\n"; ###################################################