aboutsummaryrefslogblamecommitdiffstats
path: root/utility/trunc_and_populate.sh
blob: dd8960237b36a49d3be540fc3251fbb2f1cbfb5d (plain) (tree)
1
2
3
4
5
6
7
8
9
10


                               






                                                                   



                                              
                            
#!/usr/bin/env bash

echo "Truncating the database."
if [[ "$OSTYPE" == "openbsd"* ]]; then
	psql -U postgres -f utility/truncate_script.sql ctrack
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
	sudo -u postgres psql -f utility/truncate_script.sql ctrack
else
	echo "Cannot detect operating system"
fi

sleep 1

echo "Populating the database with test data."
python manage.py populate_db