-
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
Make sure the migrations history table is created cleanly #16026
Comments
Oh weird. I wouldn’t expect this to reference a DbContext: var conventionSet = ConventionSetBuilder.CreateConventionSet(); How do you get a convention set for building a model outside of the DbContext? |
@bricelam Typically you get it explicitly for the provider you are using. For example: var conventionSet = SqlServerConventionSetBuilderf.Build(); On the other hand, the one you get from D.I. is fully configured with everything for the context, including provider conventions, any plugged-in conventions (such as for proxies), and now conventions based on the /cc @AndriySvyryd |
When #214 is implemented it will be easy to customize the conventions returned by |
Current code is: var conventionSet = Dependencies.ConventionSetBuilder.CreateConventionSet();
conventionSet.Remove(typeof(DbSetFindingConvention));
conventionSet.Remove(typeof(RelationalDbFunctionAttributeConvention)); This seems fine. |
Note from triage: this could take advantage of convention classes when available, but it does not need to. |
The issue is that now that we discover DbSets from a context as a convention, re-using the convention-laden ModelBuilder for creating the history table also brings in types from the context.
For now, the fix merged is to remove this convention, but we may want to consider other options for building the history table.
See #16024
The text was updated successfully, but these errors were encountered: