-
-
Notifications
You must be signed in to change notification settings - Fork 758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
migrate
fails due to permission issues despite being able to run SQL manually using same account
#3353
Comments
I also have the same issue when trying to use a migration against a supbase db |
Facing the same issue with postgres deplpoyed onto northflank using their add-on feature, not sure whats going on under drizzle-kit, if only there is a way to look at what sql command is sent by drizzle-kit under the hood like
update: I was able to identify that this was caused by drizzle tries to run just wanted to share how I troubleshoot this, I configured my local postgres to logs all SQL command with |
fyi: this issue seems to be a duplicate of #2161 |
@chaseweaver migrations: {
table: 'migrations',
schema: 'public',
}, then it would try to create __drizzle_migrations table inside public schema and not drizzle schema. Do you have any repro example, so I can check? |
@AndriiSherman An example DB that reproduces this error can be created from this Managing PostgreSQL users and roles page from the AWS team. If you go directly to the summary section at the end, quote below -- Revoke privileges from 'public' role
REVOKE CREATE ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON DATABASE mydatabase FROM PUBLIC; That removes all permission and then asks to assign permission as necessary. I had followed that best practices page from AWS and manually created schema: drizzle. But it fails as drizzle migrate attempts to create schema drizzle or as per above example public.migrations. It works only if I grant |
I have this issue using Drizzle with Supabase (but only on one of my supabase instances). I've given all sort of permissions to the To make matters more interesting, I did a
In the problem instance, I ran
Which completed successfully. All my connection string stuff is accurate. I see there is an open MR for #4025 but I am not sure if I have a separate issue? E: Drizzle-kit command output:
|
I am working in a locked-down database. I have full permission on
public
schema. I havemigrations.schema
set topublic
indrizzle.config.ts
. I am getting a permission denied error when runningdrizzle-kit migrate
. However, I can run the SQL manually.drizzle-kit push
also works without error.Error in question
My initial thought is there might be a check against the default
drizzle
schema prior to using the config one which is causing the command to fail since I do not have permissions for it.Running this on a non-locked down database (where I can create schemas) works fine as you'd expect.
The text was updated successfully, but these errors were encountered: