summaryrefslogtreecommitdiff
path: root/support/schema/reloadtestdb.sh
blob: 53ddf8676a18cf72414d7fbc51825866b0d031b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

mydir=`pwd`
if [ `basename $mydir` != "schema" ]; then
	echo "you must be in the aur/support/schema directory to run this script"
	exit
fi

echo "dropping old database..."
yes | mysqladmin -uaur -paur drop AUR

echo "recreating database..."
mysqladmin -uaur -paur create AUR

echo "recreating tables..."
mysql -uaur -paur AUR < ./aur-schema.sql

echo "loading dummy-data..."
bzcat ./dummy-data.sql.bz2 | mysql -uaur -paur AUR

echo "done."
exit