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

Bug when NOT NULL bit field with default value of 1 #2004

Closed
jaimestuardo opened this issue Nov 16, 2023 · 1 comment
Closed

Bug when NOT NULL bit field with default value of 1 #2004

jaimestuardo opened this issue Nov 16, 2023 · 1 comment
Labels
question Further information is requested

Comments

@jaimestuardo
Copy link

jaimestuardo commented Nov 16, 2023

Steps to reproduce

In SQL Server, create a table which contains a BIT NOT NULL field. Assign a default value of 1 and save the table.

Then, generate the model in Visual Studio (reverse engineer).

Current result

The BIT field become a nullable bool type (bool ?).

Expected result

The BIT field to become a bool type, not accepting nulls.

If I set the BIT Field as NOT NULL but with default value of 0 or no default value, model generation works as expected.

Technical details

  • EF Core Power Tools version: 2.5.1648

  • Exact Visual Studio version: Microsoft Visual Studio Community 2022 (64 bits) - Current Version 17.7.4

  • Database engine: SQL Server

  • EF Core version in use: EF Core 7.0.11

  • Is Handlebars templates used: no

  • Is T4 templates used: no

  • Is a SQL Server .dacpac used: no

@ErikEJ
Copy link
Owner

ErikEJ commented Nov 16, 2023

Duplicate of #160 (comment) - there is an advanced option to disabel this, see th wiki

@ErikEJ ErikEJ closed this as not planned Won't fix, can't repro, duplicate, stale Nov 16, 2023
@ErikEJ ErikEJ added the question Further information is requested label Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants