mnml/bin/db.sh

12 lines
341 B
Bash
Executable File

#!/bin/bash
# POSTGRES SETUP
sudo -u postgres createdb mnml
sudo -u postgres createuser --encrypted mnml
PG_PASSWORD=$(openssl rand -hex 16)
echo "database password is $PG_PASSWORD"
sudo -u postgres psql -c "alter user mnml with encrypted password '$PG_PASSWORD';"
sudo -u postgres psql -c "CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";"