Files
postgres-web/pgweb/load_initial_data.sh
Nils d174b3881e load_initial_data.sh: /bin/bash -> /bin/sh
The shell script doesn't use bash extensions and bash may not be
available on all systems at that location.
2021-11-24 14:54:43 +01:00

16 lines
483 B
Bash
Executable File

#!/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