boltcard/script/s_create_db
2023-06-29 19:34:18 +00:00

23 lines
528 B
Text
Executable file

# to close any database connections
sudo systemctl stop postgresql
sudo systemctl start postgresql
echo If you have previously created the database
echo then this will delete it and recreate it.
echo
echo Key values for cards may be in the database data.
echo
echo Continue? "(y or n)"
read x
if [ "$x" = "y" ]; then
psql postgres -f sql/create_db_init.sql
psql postgres -f sql/create_db.sql
psql postgres -f sql/create_db_user.sql
psql postgres -f sql/settings.sql.secret
echo Database created
else
echo No action
fi