Permission denied during 'migrate' command under locked-down database

I am working on a database that has certain restrictions in place for who owns what. My account in particular has full permissions on public only. When trying to run drizzle-kit migrate, I get a [...] permission denied for database [...] error. Unfortunately, this is all I can provide unless there's a way to get logs that might help. I have my config defined as
// ...
verbose: true,
migrations: {
table: 'migrations',
schema: 'public',
},
// ...
// ...
verbose: true,
migrations: {
table: 'migrations',
schema: 'public',
},
// ...
so I would expect I'd only need permissions for public. I manually created the migrations table with the matching columns and still get the error. Also, I can run the queries just fine manually, just not via migrate. No issues using push. Any help would be appreciated. Thanks!
4 Replies
dale
dale•7mo ago
Run the command as a superuser
m83
m83•5mo ago
I ran into the same issue with one of the cloud providers. Config is the same as yours, using public schema for migrations as I've only got access to it. The problem is that drizzle tries to run CREATE SCHEMA IF NOT EXISTS public which triggers permission denied (it can't create schemas, and in this case it shouldn't try as public is default one). Not sure yet what the solution is, but I think I'll drop drizzle for migrations (orm is still awesome!) - it generates too loose code to my liking, like migrations shouldn't have "if not exists" clauses..
rphlmr âš¡
rphlmr ⚡•5mo ago
👋 for if not exists their is a new rfc https://github.com/drizzle-team/drizzle-orm/discussions/2624 Do not hesitate to comment if you think about something that is not mentioned
GitHub
Updated Migration Process · drizzle-team drizzle-orm · Discussion #...
Migration process urgrade After a year of gathering feedback, we have collected enough information and identified cases that were not handled properly or need improvement. In the 0.33.0 drizzle ORM...
m83
m83•2mo ago
@Raphaël M (@rphlmr) ⚡ any timeline when this RFC is planned to see daylight? This is the only blocker for me to have drizzle running e2e from standard dx of creating/updating schemas locally to running migrations in the cloud k8s environments. I'd patch the migrator in my node_modules, but this is very flaky solution that I'd like to drop
Want results from more Discord servers?
Add your server