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
While trying to use the schema: * option to allow multiple postgres schemas to be created with the same classes, I have noticed that the update command does not generate the proper Enum types. There are all generated as *.${nativeEnumName} instead of ${options.schema}.${nativeEnumName}.
I have tracked the issue down to this code block, where meta.schema is * and thus that is what is used in generating the sql. I am unfamiliar with the project and how best this could be fixed.
output
create type "*"."axis_move_axis_type_enum"as enum ();
the create sql function also has issues with the * schema. It generates this sql, where the enum has the schema in it twice, but the create table references the enum differently.
I was looking into this yesterday, and the challenging part is diffing combined with support for enums in a specific schema (for entity in wildcard schema). Will need to give it a bit more time, worst case I'll implement at least the support for wildcard enums in general, as that should be rather easy (and I got that mostly already implemented locally).
Describe the bug
While trying to use the
schema: *
option to allow multiple postgres schemas to be created with the same classes, I have noticed that the update command does not generate the proper Enum types. There are all generated as*.${nativeEnumName}
instead of${options.schema}.${nativeEnumName}
.I have tracked the issue down to this code block, where meta.schema is
*
and thus that is what is used in generating the sql. I am unfamiliar with the project and how best this could be fixed.output
desired output
mikro-orm/packages/knex/src/schema/DatabaseSchema.ts
Lines 88 to 101 in 5180b6a
additional context
the create sql function also has issues with the
*
schema. It generates this sql, where the enum has the schema in it twice, but the create table references the enum differently.Reproduction
What driver are you using?
@mikro-orm/postgresql
MikroORM version
6.2.1
Node.js version
v20.11.1
Operating system
No response
Validations
The text was updated successfully, but these errors were encountered: