change supervisor field in tc_district and tc_district_sandbox to leader
[eq/.git] / bin / upgrade_1_1_0_to_1_1_1
index 9bb7ff609f2fd0e0f7ff3acb4d7cbe904b45b385..942472891d7a918a93bb0a983ab7bf432fbcc481 100755 (executable)
@@ -36,6 +36,18 @@ $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";
 
 ###################################################