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
Schema generator- Skip Tables and Skip Columns #5346
Comments
So you have |
That is correct. I realize it's not critical and there are plenty of workarounds. Just an idea I had based on the functionality existing in the other direction (Entity Generator). I appreciate the response! Mikro- Orm is the GOAT, really loving it. Thank you for your work. |
I would love for a way to create indexes that aren't even considered by the schema migrator. I am creating some manual indexes that I don't think I can create using the decorators. Here is an example (I'm using postgresql): create index "manual_blog_post_search_index" on "blog_post" ("user_id", lower("title") collate "C", "created_at", "category_id"); In this case I need For context, I use this in my query: [raw('lower("title") ^@ ?', [titlePrefix])]: [], So this is an example of an index that I don't think mikro-orm can create using the decorators, which is fine because I am perfectly happy creating them manually. But the annoying part is that the migration generator wants to remove them. 😭 I think one simple solution would be to ignore indexes whose name doesn't start with the table name. All mikro-orm indexes starts with the table name (e.g. I hope that makes sense. :) |
You can create any index via index expressions, see the |
Is your feature request related to a problem? Please describe.
Piggy-backing off this issue that was implemented: issue ,
I'd like the ability to skip certain tables or columns during schema generation. I am using supabase which has an auth schema by default that has a users table that I want the entity for but many other tables that I don't need. I do have "auth" set in the ignoreSchema array option on the schemaGenerator in my config. But obviously that makes the generator think that auth.users needs to be created. If I remove "auth" from the array, it tries to remove everything from auth that isn't the users table.
Describe the solution you'd like
A skipTables and skipColumns option in the schemaGenerator.
Describe alternatives you've considered
I've moved on by defining a normal PK for my public.profile table that is not linked to the foreign users key in the auth schema. This is not ideal as it's important to me to maintain the FK constraints.
The text was updated successfully, but these errors were encountered: