summaryrefslogtreecommitdiff
path: root/pgweb/load_initial_data.sh
blob: af9a5fda99ae76c84e9734b0f5daefe8c6832fb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

# We keep this in a separate script because using initial_data.xxx in django will overwrite
# critical data in the database when running a 'syncdb'. We'd like to keep the ability to
# run syncdb on updates...

echo WARNING: this may overwrite some data in the database with an initial set of data.
echo 'Are you sure you want this (answer "yes" to overwrite)'
read R

cd $(dirname $0)

if [ "$R" = "yes" ]; then
   find . -name data.json | xargs ../manage.py loaddata
fi