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

Not null sql column with -1 default value #28094

Closed
Dimigergo opened this issue May 25, 2022 · 1 comment
Closed

Not null sql column with -1 default value #28094

Dimigergo opened this issue May 25, 2022 · 1 comment

Comments

@Dimigergo
Copy link

I have this small repo:
EFCoreColumnDefault.zip

In the .sql file we have a table with an IntCmn, and IntCmnDef integer column. Both are the same, but the IntCmnDef column has a defaul value with -1.

In the repo we have 3 insert, but the last two insert are the same result, with IntCmnDef column value -1.
The last inserted value should be 0, because the 0 value is not the default of the column, but a valid number.

I see, that it is complicated to determine if the user set the 0 value of the property or the C# integer default value is that, but in this case, there are errors when use a column with default value which is different from the integer default value.

EF Core Power Tools 2.5.982
EF Core 5.0.16
Visual Studio 2022 (17.1.6)

@ajcvickers
Copy link
Member

Duplicate of #701.

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
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

2 participants