Files
postgres-web/pgweb/load_initial_data.sh
Magnus Hagander c24eea14ab Initial data must not live in initial_data.yaml, that will cause the data that's currently
in the database to be overwritten... Put it in a separate file, and add a script that will
automatically load all these files if present.
2009-09-16 13:16:04 +02:00

14 lines
466 B
Bash
Executable File

#!/bin/bash
# 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
if [ "$R" == "yes" ]; then
find . -name data.yaml | xargs ./manage.py loaddata
fi