moviewyrm/rebuilddb.sh

26 lines
434 B
Bash
Raw Normal View History

2020-01-26 20:14:27 +00: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 22:19:36 +00:00
source .env
2020-09-21 15:27:12 +00:00
if [ $BOOKWYRM_DATABASE_BACKEND = 'sqlite' ]; then
if [ -f fedireads.db ]; then
rm fedireads.db
fi
2020-02-15 22:19:36 +00:00
else
# assume postgres
dropdb fedireads
createdb fedireads
fi
2020-01-26 20:14:27 +00:00
python manage.py makemigrations fedireads
python manage.py migrate
2020-11-08 18:29:33 +00:00
python manage.py initdb
2020-01-27 01:55:02 +00:00
python manage.py runserver