Files
postgres-web/pgweb/load_initial_data.sh
Andreas 'ads' Scherbaum 11aaa66f55 Change equality operator from bash to posix sh
The == operator is Bash specific, and since the script isn't Bash
specific the = operator should be used instead.

Author: Andreas 'ads' Scherbaum <ads@pgug.de>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://postgr.es/m/671fc8a3-8106-be8d-d6a6-325e19b8358f@pgug.de
2022-03-24 10:32:27 +01:00

16 lines
482 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