projects
/
eq
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed missing AUTO INCREMENT property on some fields
[eq/.git]
/
bin
/
upgrade_4_0_to_5_0
diff --git
a/bin/upgrade_4_0_to_5_0
b/bin/upgrade_4_0_to_5_0
index 4c88c2a584602ba4476758f15476a3efc303f617..f1952234504a53eeb0be93c2790d1c217ba1b4b6 100755
(executable)
--- a/
bin/upgrade_4_0_to_5_0
+++ b/
bin/upgrade_4_0_to_5_0
@@
-16,7
+16,7
@@
$dbh=DBI->connect("dbi:mysql:dbname=$dbname:host=$dbhost:port=$dbport",$dbuser,$
###################################################
# Remove eq_aaronic table
###################################################
# Remove eq_aaronic table
-$sth = $dbh->prepare("DROP TABLE
`eq_aaronic` IF EXISTS
");
+$sth = $dbh->prepare("DROP TABLE
IF EXISTS `eq_aaronic`
");
$sth->execute or die "-E- DB error: $DBI::errstr\n";
# Rename eq_activity table to tc_activity
$sth->execute or die "-E- DB error: $DBI::errstr\n";
# Rename eq_activity table to tc_activity
@@
-48,7
+48,7
@@
$sth = $dbh->prepare("RENAME TABLE `eq_calling` TO `tc_calling`");
$sth->execute or die "-E- DB error: $DBI::errstr\n";
# Remove eq_child table
$sth->execute or die "-E- DB error: $DBI::errstr\n";
# Remove eq_child table
-$sth = $dbh->prepare("DROP TABLE
`eq_child` IF EXISTS
");
+$sth = $dbh->prepare("DROP TABLE
IF EXISTS `eq_child`
");
$sth->execute or die "-E- DB error: $DBI::errstr\n";
# Rename eq_companionship table to tc_companionship
$sth->execute or die "-E- DB error: $DBI::errstr\n";
# Rename eq_companionship table to tc_companionship
@@
-56,7
+56,7
@@
$sth = $dbh->prepare("RENAME TABLE `eq_companionship` TO `tc_companionship`");
$sth->execute or die "-E- DB error: $DBI::errstr\n";
# Remove aaronic field from tc_companionship
$sth->execute or die "-E- DB error: $DBI::errstr\n";
# Remove aaronic field from tc_companionship
-$sth = $dbh->prepare("ALTER TABLE
'tc_companionship' DROP 'aaronic'
");
+$sth = $dbh->prepare("ALTER TABLE
`tc_companionship` DROP `aaronic`
");
$sth->execute or die "-E- DB error: $DBI::errstr\n";
# Change elder field in tc_companionship table to indiv
$sth->execute or die "-E- DB error: $DBI::errstr\n";
# Change elder field in tc_companionship table to indiv
@@
-72,7
+72,7
@@
$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->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 = $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 'birthday' column to the tc_indiv table
$sth->execute or die "-E- DB error: $DBI::errstr\n";
# Add a new 'birthday' column to the tc_indiv table
@@
-104,7
+104,7
@@
$sth = $dbh->prepare("ALTER TABLE `tc_family` CHANGE `elder_id` `indiv_id` INT(1
$sth->execute or die "-E- DB error: $DBI::errstr\n";
# Remove eq_parent table
$sth->execute or die "-E- DB error: $DBI::errstr\n";
# Remove eq_parent table
-$sth = $dbh->prepare("DROP TABLE
`eq_parent` IF EXISTS
");
+$sth = $dbh->prepare("DROP TABLE
IF EXISTS `eq_parent`
");
$sth->execute or die "-E- DB error: $DBI::errstr\n";
# Rename eq_participation table to tc_participation
$sth->execute or die "-E- DB error: $DBI::errstr\n";
# Rename eq_participation table to tc_participation
@@
-124,11
+124,11
@@
$sth = $dbh->prepare("ALTER TABLE `tc_interview` CHANGE `elder` `indiv` INT(16)"
$sth->execute or die "-E- DB error: $DBI::errstr\n";
# Remove aaronic field from tc_interview
$sth->execute or die "-E- DB error: $DBI::errstr\n";
# Remove aaronic field from tc_interview
-$sth = $dbh->prepare("ALTER TABLE
'tc_interview' DROP 'aaronic'
");
+$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->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
$sth->execute or die "-E- DB error: $DBI::errstr\n";
# Add a new 'interview_type' column to the tc_interview table