removing birthday field from tc_indiv since we don't use it and it is personal info
[eq/.git] / bin / upgrade_4_0_to_5_0
index 4fabba93fe5e06c7f37dcebefed88e88b56a0b03..c27fa3ac4f2b1dd473001258455e89c8fd575ec2 100755 (executable)
@@ -72,15 +72,11 @@ $sth = $dbh->prepare("RENAME TABLE `eq_elder` TO `tc_indiv`");
 $sth->execute or die "-E- DB error: $DBI::errstr\n";
 
 # Change elder field in tc_indiv table to indiv
-$sth = $dbh->prepare("ALTER TABLE `tc_indiv` CHANGE `elder` `indiv` INT(16)");
-$sth->execute or die "-E- DB error: $DBI::errstr\n";
-
-# Add a new 'birthday' column to the tc_indiv table
-$sth = $dbh->prepare("ALTER TABLE `tc_indiv` ADD `birthday` DATE NULL DEFAULT NULL AFTER `name` ");
+$sth = $dbh->prepare("ALTER TABLE `tc_indiv` CHANGE `elder` `indiv` INT(16) NOT NULL AUTO_INCREMENT");
 $sth->execute or die "-E- DB error: $DBI::errstr\n";
 
 # Add a new 'address' column to the tc_indiv table
-$sth = $dbh->prepare("ALTER TABLE `tc_indiv` ADD `address` VARCHAR( 255 ) NULL DEFAULT NULL AFTER `birthday`");
+$sth = $dbh->prepare("ALTER TABLE `tc_indiv` ADD `address` VARCHAR( 255 ) NULL DEFAULT NULL AFTER `name`");
 $sth->execute or die "-E- DB error: $DBI::errstr\n";
 
 # Add a new 'family' column to the tc_indiv table
@@ -128,7 +124,7 @@ $sth = $dbh->prepare("ALTER TABLE `tc_interview` DROP `aaronic`");
 $sth->execute or die "-E- DB error: $DBI::errstr\n";
 
 # Change ppi field in tc_interview table to interview
-$sth = $dbh->prepare("ALTER TABLE `tc_interview` CHANGE `ppi` `interview` INT(16)");
+$sth = $dbh->prepare("ALTER TABLE `tc_interview` CHANGE `ppi` `interview` INT(16) NOT NULL AUTO_INCREMENT");
 $sth->execute or die "-E- DB error: $DBI::errstr\n";
 
 # Add a new 'interview_type' column to the tc_interview table