Skip to content

Commit

Permalink
Merge pull request #21 from MoveOnOrg/sjwmoveon-patch-1
Browse files Browse the repository at this point in the history
Add instructions for local postgres
  • Loading branch information
sjwmoveon authored Sep 3, 2024
2 parents 22977c9 + 7e6e1bd commit 12a0729
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions docs/HOWTO_USE_POSTGRESQL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@ To use Postgresql, follow these steps:

1. Either install docker (recommended) or postgresql on your machine:
* If you installed docker run the database using: `docker-compose up`
* If you installed postgres locally, create the spoke dev database: `psql -c "create database spokedev;"`
* Then create a spoke user to connect to the database with `createuser -P spoke` with password "spoke" (to match the credentials in the .env.example file)
* If you installed postgres locally (or if you already have a local installation of postgres), create the spoke dev database: `psql -c "create database spokedev;"`
* Then create a spoke user to connect to the database with `psql -d spokedev -c "create user spoke with password 'spoke';"` (to match the credentials in the .env.example file)
* Grant permissions to the new Spoke user:
* `psql -d spokedev -c "GRANT ALL PRIVILEGES ON DATABASE spokedev TO spoke;"`
* `psql -d spokedev -c "GRANT ALL PRIVILEGES ON schema public TO spoke;"`
* Also run the commands from `./dev-tools/create-test-database`:
```
psql -d spokedev
CREATE DATABASE spoke_test;
CREATE USER spoke_test WITH PASSWORD 'spoke_test';
GRANT ALL PRIVILEGES ON DATABASE spoke_test TO spoke_test;
```
1. In `.env` set `DB_TYPE=pg`. (Otherwise, you will use sqlite.)
2. Set `DB_PORT=5432`, which is the default port for Postgres.

Expand Down

0 comments on commit 12a0729

Please sign in to comment.