-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
ModelBuilder: API for removing indexes and foreign keys #7605
Comments
Possibly a generalization of #2725 could help this scenario, i.e. an annotation that once added to an element in metadata, instructs migrations not to create the corresponding database object for it. |
Ran into a requirement for this and finally stumbled upon this Issue. The workaround suggested by @AndriySvyryd here doesn't seem to work for me. Internal APIs may have changed. Let me know if I can assist at all with this feature. |
@collinbarrett The current workaround is to disable conventions by calling
But since this is also Internal code and will be broken in the future |
Ah, ok, thanks, @AndriySvyryd . Hmm, yeah, I probably don't want to disable conventions globally at this point. Will probably just manually remove from migrations for now. Thanks! |
The conventions will only be disabled after that call is made, so if the only thing that follows is removing indexes then nothing else would be affected, see #10855 (comment) |
Note: see workarounds on #6239. |
I'm having the same issue; I need a table without an index on a foreign key, and the above solutions are not officially supported, and the workaround listed in #6239 does not work. At the moment, I am manually modifying the migration to prevent the index from being created. |
I have created an implementation of |
still no solution to this day?. |
Split off from #7530
Currently there is no way to remove an index that was introduced by convention. You have to use internal APIs to do it.
The text was updated successfully, but these errors were encountered: