1
0
Fork 0
bookwyrm/rebuilddb.sh

26 lines
434 B
Bash
Raw Normal View History

2020-01-26 12:14:27 -08:00
#!/bin/bash
set -e
if [ ! -f .env ]; then
echo "No .env found -- copying .example.env to .env!"
cp .env.example .env
fi
2020-02-15 14:19:36 -08:00
source .env
2020-09-21 08:27:12 -07:00
if [ $BOOKWYRM_DATABASE_BACKEND = 'sqlite' ]; then
if [ -f fedireads.db ]; then
rm fedireads.db
fi
2020-02-15 14:19:36 -08:00
else
# assume postgres
dropdb fedireads
createdb fedireads
fi
2020-01-26 12:14:27 -08:00
python manage.py makemigrations fedireads
python manage.py migrate
2020-11-08 10:29:33 -08:00
python manage.py initdb
2020-01-26 17:55:02 -08:00
python manage.py runserver