Remove PG_USER from script, we will rely on POSTGRES_USER for this

This commit is contained in:
Jackson Harper
2023-05-10 11:56:53 +08:00
parent f8fc1306df
commit aaaa1e6790

View File

@ -1,16 +1,16 @@
#!/bin/sh
echo "creating omnivore database with $(which psql)"
psql --host $PG_HOST -U $PG_USER -c "CREATE DATABASE omnivore;"
psql --host $PG_HOST -c "CREATE DATABASE omnivore;"
echo "creating app_user"
psql --host $PG_HOST -U $PG_USER -d $PG_DB -c "CREATE USER app_user WITH PASSWORD 'app_pass';"
psql --host $PG_HOST -d $PG_DB -c "CREATE USER app_user WITH PASSWORD 'app_pass';"
echo "created app_user"
echo "running migrations"
yarn workspace @omnivore/db migrate
psql --host $PG_HOST -U $PG_USER -d $PG_DB -c "GRANT omnivore_user TO app_user;"
psql --host $PG_HOST -d $PG_DB -c "GRANT omnivore_user TO app_user;"
echo "granted omnivore_user to app_user"
yarn workspace @omnivore/api start