change tc_interview.interviewer to point to tc_leader.leader instead of tc_individual...
[eq/.git] / bin / upgrade_1_1_0_to_1_1_1
index 21b6bede198aafc54d07bf9e2e6c337f395991da..0337a6e2564c6b283b38d0d389aa9115cf7e1a56 100755 (executable)
@@ -86,6 +86,9 @@ $sth->execute or die "-E- DB error: $DBI::errstr\n";
 $sth = $dbh->prepare("ALTER TABLE `tc_visit` DROP `companion1`, DROP `companion2`");
 $sth->execute or die "-E- DB error: $DBI::errstr\n";
 
+# change tc_interview so interviewer points to tc_leader.leader
+$sth = $dbh->prepare("UPDATE tc_interview AS ti JOIN tc_leader AS tl SET ti.interviewer=tl.leader WHERE ti.interviewer=tl.individual");
+$sth->execute or die "-E- DB error: $DBI::errstr\n";
 
 
 print "-> Done!\n";