You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit runs a create schema if not exists on running migrations on postgres if I am not mistaken. The corresponding query will fail if the assigned user does not have appropriate permissions, even if the schema already exists. This is not ideal, as it requires giving the MikroORM users additional permissions.
Error on running the migrations:
error: create schema if not exists "public" - permission denied for database onboarding
at Parser.parseErrorMessage (/Users/mpauly/something/node_modules/pg-protocol/src/parser.ts:369:69)
at Parser.handlePacket (/Users/mpauly/something/node_modules/pg-protocol/src/parser.ts:188:21)
at Parser.parse (/Users/mpauly/something/node_modules/pg-protocol/src/parser.ts:103:30)
at Socket.<anonymous> (/Users/mpauly/something/node_modules/pg-protocol/src/index.ts:7:48)
To Reproduce
Steps to reproduce the behavior:
Setup a database and create a user that does not have permissions to edit schemas
Create an initial migration with npm run mikro-orm -- migration:create
Apply the migration with npm run mikro-orm -- migration:up
Expected behavior
The migration is applied as a schema already exists.
Versions
As expected, for me the bug only occurs with version 5.1.3.
Dependency
Version
node
17.6.0
typescript
4.6.2
mikro-orm
5.1.3
@mikro-orm/postgresql
5.1.3
The text was updated successfully, but these errors were encountered:
How does your ORM config look like? This query should be invoked only if you specify the schema name explicitly in the migrations table name. Which you should not if its public schema, as that is the default.
This commit runs a
create schema if not exists
on running migrations on postgres if I am not mistaken. The corresponding query will fail if the assigned user does not have appropriate permissions, even if the schema already exists. This is not ideal, as it requires giving the MikroORM users additional permissions.Error on running the migrations:
To Reproduce
Steps to reproduce the behavior:
npm run mikro-orm -- migration:create
npm run mikro-orm -- migration:up
Expected behavior
The migration is applied as a schema already exists.
Versions
As expected, for me the bug only occurs with version 5.1.3.
The text was updated successfully, but these errors were encountered: