Skip to content
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

RevEng: Decimal column with same precision and scale as the default produce warnings at runtime #12241

Open
Tracked by #22948
johanskoldekrans opened this issue Jun 5, 2018 · 7 comments

Comments

@johanskoldekrans
Copy link

I have a sort of related "issue" to #6965.

If my column in the database is decimal(18,2) the scaffolding will not produce .HasColumnType("decimal(18, 2)") since I guess it is equal to the default.

BUT on the other hand I get frightening warnings when I run the project that no type was specified for the decimal column and that the values might be silently truncated.

It would be best if the scaffolding produced the HascolumnType even if it is equal to the current default so I dont get heartattacks from the warnings. :-)

Further technical details

EF Core version: 2.1
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Win10
IDE: Visual Studio 2017 15.7.3

@smitpatel
Copy link
Member

Marking for re-triage. Currently decimal warning is in ModelValidator code. And the inference about requiring HasColumnType happens in ScaffoldingTypeMapper via TypeMappingSource. We don't have enough information available to do this in provider agnostic way right now.

@ajcvickers
Copy link
Member

Triage: we will make a change to always scaffold a column type for decimal for all providers. This means there may be some extra configuration in the model that is not needed, but there will be no warnings at runtime. We will then leave this issue open to do a provider-specific fix once the infrastructure is in place.

@ajcvickers ajcvickers added this to the 2.2.0 milestone Sep 12, 2018
@bricelam bricelam removed their assignment Sep 18, 2018
@smitpatel smitpatel added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Sep 19, 2018
@smitpatel smitpatel changed the title Decimal column with same precision and scale as the default produce warnings at runtime RevEng: Decimal column with same precision and scale as the default produce warnings at runtime Sep 21, 2018
@bricelam
Copy link
Contributor

Reopening:

We will then leave this issue open to do a provider-specific fix once the infrastructure is in place.

@bricelam bricelam reopened this Sep 21, 2018
@bricelam bricelam removed this from the 2.2.0 milestone Sep 21, 2018
@ajcvickers ajcvickers removed the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Sep 24, 2018
@ajcvickers ajcvickers modified the milestones: 3.0.0, Backlog Sep 24, 2018
@ErikEJ
Copy link
Contributor

ErikEJ commented May 9, 2019

@bricelam Why is this still open?

@smitpatel
Copy link
Member

We want to scaffold the decimal type only in SqlServer provider rather than everywhere. So providers have to contribute in certain way that, ClrType requires HasColumnType regardless of it being default.

@dengere
Copy link

dengere commented Feb 11, 2023

@bricelam Why is this still open?

Reply from future; Why is this still open?

@ajcvickers
Copy link
Member

@dengere Because the work to implement this hasn't been done.

@bricelam bricelam removed their assignment Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants