Skip to content

Commit

Permalink
Added instructions to database docs for connecting to the primary ins…
Browse files Browse the repository at this point in the history
…tance (#551)
  • Loading branch information
JumboLove authored Dec 7, 2023
1 parent 5a226e2 commit 949c4b1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ you can utilize Fly's `ssh` and `proxy` commands.
fly proxy 5556:5555 --app [YOUR_APP_NAME]
```

If you have multiple instances of your app running, and you'd like to make edits to your database, you will need to run `prisma:studio` on the primary instance.

- Get a list of your app instances, the `ROLE` column will show which instance is `primary`
```sh
fly status --app [YOUR_APP_NAME]
```
- Run the console command with the `-s` select flag
```sh
fly ssh console -C "npm run prisma:studio" -s --app [YOUR_APP_NAME]
```
- Use your arrow keys to select the primary instance

To work with Prisma Studio and your deployed app's database, simply open
`http://localhost:5556` in your browser.

Expand Down

0 comments on commit 949c4b1

Please sign in to comment.