Skip to content

Commit

Permalink
docs(server): Update database README
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustl22 committed Nov 27, 2023
1 parent b596805 commit 91c1380
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions wrestling_scoreboard_server/database/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ On Linux you may want to login as postgres user: `sudo -u postgres -i`

- Open psql command line: `psql -U postgres`
- List all users: `\du`
- Start the serveR: `postgres -D /.../PostgreSQL/16/data`

### Setup User:

Expand All @@ -33,9 +34,12 @@ psql -U postgres -c "CREATE USER wrestling WITH PASSWORD 'my_password';"

Reset current database:
```shell
psql -U postgres -c "DROP DATABASE IF EXISTS wrestling_scoreboard;"
psql -U postgres -c "CREATE DATABASE wrestling_scoreboard;"
psql -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE wrestling_scoreboard to wrestling;"
psql -U postgres
postgres=#
```
```postgresql
DROP DATABASE IF EXISTS wrestling_scoreboard;
CREATE DATABASE wrestling_scoreboard WITH OWNER = wrestling;
```

Restore prepopulated database, execute in directory `server`:
Expand Down

0 comments on commit 91c1380

Please sign in to comment.