Commit | Line | Data |
---|---|---|
a90ca862 RB |
1 | #!/bin/bash |
2 | ||
3 | . ../inc/pervasive.sh | |
4 | ||
bb9d47f4 FB |
5 | ########################################################### |
6 | [ "$DATABASE" != "x4dat" ] || die "Cannot target x4dat" | |
7 | ||
751a2f4f FB |
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\"" | |
bb9d47f4 | 10 | |
01bb23e6 | 11 | echo "* create database" |
652f22ee | 12 | mysql_exec_nodb "CREATE DATABASE IF NOT EXISTS $DATABASE;" |
bb9d47f4 FB |
13 | echo "OK" |
14 | ||
01bb23e6 RB |
15 | echo "* copying tables " |
16 | (../account/copy_tables.sh | while read line; do mysql_exec "$line"; done) || die "ERROR" | |
bb9d47f4 FB |
17 | echo "OK" |
18 | ||
19 | mysql_run_directory ../newdirectory-0.0.1 | |
20 | mysql_run_directory ../account | |
21 | mysql_run_directory . | |
a90ca862 RB |
22 | |
23 | ########################################################### | |
01bb23e6 | 24 | confirm "* Running upgrade scripts" |
bb9d47f4 FB |
25 | script_run ../newdirectory-0.0.1/phones.php |
26 | script_run ../newdirectory-0.0.1/addresses.php | |
bb9d47f4 | 27 | script_run ../account/birthday.php |