Creating script which migrates map database to new database for custom niceness.

This commit is contained in:
Roland 2025-01-01 10:59:28 -07:00
parent 28fbc8f197
commit 7324e83626
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
15 changed files with 126 additions and 57 deletions

View file

@ -11,11 +11,11 @@ fi
set -x
# Create WROLPi API database.
sudo -u postgres psql -c '\l' | grep wrolpi || (
sudo -u postgres createuser -s wrolpi # superuser so maps can be imported
sudo -u postgres psql -c "alter user postgres password 'wrolpi'"
sudo -u postgres psql -c "alter user wrolpi password 'wrolpi'"
sudo -u postgres createdb -E UTF8 -O wrolpi wrolpi
sudo -iu postgres psql -c '\l' | grep wrolpi || (
sudo -iu postgres createuser -s wrolpi # superuser so maps can be imported
sudo -iu postgres psql -c "alter user postgres password 'wrolpi'"
sudo -iu postgres psql -c "alter user wrolpi password 'wrolpi'"
sudo -iu postgres createdb -E UTF8 -O wrolpi wrolpi
echo "Created wrolpi database"
)
sudo -u wrolpi /bin/bash -c 'cd /opt/wrolpi && /opt/wrolpi/venv/bin/python3 main.py db upgrade'
sudo -iu wrolpi /bin/bash -c 'cd /opt/wrolpi && /opt/wrolpi/venv/bin/python3 main.py db upgrade'