-
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
Hidden columns are scaffolded #8192
Comments
Note that is_hidden in sys.columns only applies to SQL Server 2016 and Azure SQL Database |
We think that hidden columns should not be scaffolded. We're not going to do it for 2.0, but we would consider a well coded PR to do it. |
@ajcvickers @lajones What SQL Server version(s) does the SQL Server design tests run against? |
@lajones - Everything going into dev now is 2.0.0 milestone. We already branched. |
@smitpatel Sorry - selected wrong dropdown. Thx for fixing. |
When scaffolding a database to EF Core, Hidden Columns are not excluded. As a result, columns used for SQL Temporal Tables get scaffolded back into the application. As a result, if the DB has not had those turned on, it breaks the EF code against another database which does not have them.
Steps to reproduce
Create a Database Project and scaffold it to a SQL Server.
Now run Scaffold-DbContext to build your EF context off that server.
Then in SQL Server follow these steps https://docs.microsoft.com/en-us/sql/relational-databases/tables/creating-a-system-versioned-temporal-table#alter-non-temporal-table-to-be-system-versioned-temporal-table to add Temporal System Versioning.
Now scaffold from the database again. Notice that the versioning columns are added, despite the fact they are marked as hidden in SQL.
The text was updated successfully, but these errors were encountered: