[X] I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Feature:
Provide a way to bypass the check CREATE SCHEMA IF NOT EXISTS ${sql.identifier(migrationsSchema)}
when the default "public" schema is used in Postgres with
Reason:
It is possible that in high regulated environments the user executing the migration doesn't have the permissions for any operation on the schema, even checking if it exists (this is the reason why we use "public" in the first place).
The above statement will trigger an error "permission denied" and abort the entire migration.
Feature hasn't been suggested before.
Describe the enhancement you want to request
Feature: Provide a way to bypass the check
CREATE SCHEMA IF NOT EXISTS ${sql.identifier(migrationsSchema)}
when the default "public" schema is used in Postgres withReason: It is possible that in high regulated environments the user executing the migration doesn't have the permissions for any operation on the schema, even checking if it exists (this is the reason why we use "public" in the first place). The above statement will trigger an error "permission denied" and abort the entire migration.
It should be quite easy just changing https://github.com/drizzle-team/drizzle-orm/blob/30e5347c5b363e4ae5e30be78ac0bf64feaf98d4/drizzle-orm/src/pg-core/dialect.ts#L85 with
The
public
schema should exists by default in Postgres https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-PUBLICI can create a PR for it if you're happy with the approach.