LukeMathWalker / LukeMathWalker/zero-to-production
Digital Ocean sqlx migrate error - Chapter 5
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6.5k
- Forks
- 585
- PR merge metrics
- No merged PRs in 30d
Description
I think it's possible Digital Ocean have changed how they do things, or I just goofed up.
When trying to run the migration on page 157 (last of chapter 5), I get an error that I don't have permission on public schema.
I used the psql command with the same connection string to confirm the string was correct, psql also confirmed the "newsletter" user can connect to the DB, but doesn't have permissions on public.
I either goofed up, or Digital Ocean changed things.
If anyone else has this issue, this is the workaround I found:
Digital Ocean doesn't give us a connection string for an admin user to the db, however we can get it through their API
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/databases//users"
The DB_ID is in the databases settings on the console
This should return two users, and their passwords. The "newsletter" user, and a "doadmin" user. Connect to the DB with the "doadmin" login using psql, and update the permissions on the schema. You may need to set default permissions on tables in the schema as well.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at chapter 5, page 157, and review the sqlx migration instructions for DigitalOcean PostgreSQL databases. Verify the psql permission failure and the documented doadmin/API workaround, then update the chapter so readers can complete the migration; done means the permissions guidance reflects the reported setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql
- Domain
- databases, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100