Repository navigation
Store database type name in model snapshot - #16484
Merged
Merged
Conversation
Fixes #16239 Fixes #12212 Also, make the SnapshotModelProcessor finalize the model. I investigated whether it would be better to only store this sometimes, but that then still requires making some assumptions (basically using some conventions and/or the type mapper doing what it does in conventions) when loading the snapshot to ensure we find the right type for the provider being used. Storing it always is clean and simple, decouples from conventions when loading, and means we don't have to do special magic for facets that come from value converters.
AndriySvyryd
approved these changes
Jul 7, 2019
ghost
deleted the
MagicRoundabout0705
branch
July 7, 2019 16:05
bricelam
reviewed
Jul 8, 2019
| .Append(".") | ||
| .Append(nameof(RelationalPropertyBuilderExtensions.HasColumnType)) | ||
| .Append("(") | ||
| .Append(Code.UnknownLiteral(property.GetColumnType())) |
Contributor
There was a problem hiding this comment.
Code.Literal() is preferred when they type is statically known.
|
|
||
| b.Property<decimal>(""EnumU64"") | ||
| .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0))); | ||
| .HasColumnType(""decimal(20,0)""); |
ajcvickers
added a commit
that referenced
this pull request
Jul 8, 2019
ajcvickers
added a commit
that referenced
this pull request
Jul 8, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #16239
Fixes #12212
Also, make the SnapshotModelProcessor finalize the model.
I investigated whether it would be better to only store this sometimes, but that then still requires making some assumptions (basically using some conventions and/or the type mapper doing what it does in conventions) when loading the snapshot to ensure we find the right type for the provider being used. Storing it always is clean and simple, decouples from conventions when loading, and means we don't have to do special magic for facets that come from value converters.