Moving to GitHub.
[platal.git] / upgrade / 1.0.0 / update.sh
1 #!/bin/bash
2
3 . ../inc/pervasive.sh
4
5 ###########################################################
6 [ "$DATABASE" != "x4dat" ] || die "Cannot target x4dat"
7
8 echo "Setting up new database: target db is \"$DATABASE\", source prefix is \"$DBPREFIX\""
9 confirm "Please ensure your platal.conf is configured to use \"$DATABASE\""
10
11 echo "* create database"
12 mysql_exec_nodb "CREATE DATABASE IF NOT EXISTS $DATABASE;"
13 echo "OK"
14
15 echo "* copying tables "
16 (../account/copy_tables.sh | while read line; do mysql_exec "$line"; done) || die "ERROR"
17 echo "OK"
18
19 mysql_run_directory ../newdirectory-0.0.1
20 mysql_run_directory ../account
21 mysql_run_directory .
22
23 ###########################################################
24 confirm "* Running upgrade scripts"
25 script_run ../newdirectory-0.0.1/phones.php
26 script_run ../newdirectory-0.0.1/addresses.php
27 script_run ../account/birthday.php