Merge remote branch 'origin/xorg/maint' into xorg/master
[platal.git] / upgrade / 1.0.0 / update.sh
index 3c3a41e..3a7acb3 100755 (executable)
@@ -5,14 +5,15 @@
 ###########################################################
 [ "$DATABASE" != "x4dat" ] || die "Cannot target x4dat"
 
-confirm "Setting up new database: target db is \"$DATABASE\", source prefix is \"$DBPREFIX\""
+echo "Setting up new database: target db is \"$DATABASE\", source prefix is \"$DBPREFIX\""
+confirm "Please ensure your platal.conf is configured to use \"$DATABASE\""
 
-echo -n "* create database "
-(echo "CREATE DATABASE IF NOT EXISTS $DATABASE;" | mysql_pipe) || die "ERROR"
+echo "* create database"
+mysql_exec_nodb "CREATE DATABASE IF NOT EXISTS $DATABASE;"
 echo "OK"
 
-echo -n "* copying tables "
-(../account/copy_tables.sh | mysql_pipe) || die "ERROR"
+echo "* copying tables "
+(../account/copy_tables.sh | while read line; do mysql_exec "$line"; done) || die "ERROR"
 echo "OK"
 
 mysql_run_directory ../newdirectory-0.0.1
@@ -20,8 +21,7 @@ mysql_run_directory ../account
 mysql_run_directory .
 
 ###########################################################
-confirm "Running upgrade scripts"
+confirm "Running upgrade scripts"
 script_run ../newdirectory-0.0.1/phones.php
 script_run ../newdirectory-0.0.1/addresses.php
-script_run ../newdirectory-0.0.1/alternate_subsubsectors.php
 script_run ../account/birthday.php