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

Hidden columns are scaffolded #8192

Closed
rposener opened this issue Apr 17, 2017 · 5 comments
Closed

Hidden columns are scaffolded #8192

rposener opened this issue Apr 17, 2017 · 5 comments
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. good first issue This issue should be relatively straightforward to fix. help wanted This issue involves technologies where we are not experts. Expert help would be appreciated. type-bug
Milestone

Comments

@rposener
Copy link

rposener commented Apr 17, 2017

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.

@ErikEJ
Copy link
Contributor

ErikEJ commented Apr 17, 2017

Note that is_hidden in sys.columns only applies to SQL Server 2016 and Azure SQL Database

@ajcvickers ajcvickers added this to the 2.0.0 milestone Apr 17, 2017
@ajcvickers ajcvickers modified the milestones: Backlog, 2.0.0 Apr 17, 2017
@ajcvickers ajcvickers added the help wanted This issue involves technologies where we are not experts. Expert help would be appreciated. label Apr 17, 2017
@ajcvickers
Copy link
Contributor

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.

@ErikEJ
Copy link
Contributor

ErikEJ commented Apr 24, 2017

@ajcvickers @lajones What SQL Server version(s) does the SQL Server design tests run against?

ErikEJ pushed a commit to ErikEJ/EntityFramework that referenced this issue Apr 25, 2017
ErikEJ pushed a commit to ErikEJ/EntityFramework that referenced this issue Apr 27, 2017
@lajones lajones added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Apr 27, 2017
@lajones lajones modified the milestones: 2.0.0-preview1, Backlog Apr 27, 2017
@smitpatel smitpatel modified the milestones: 2.0.0, 2.0.0-preview1 Apr 27, 2017
@smitpatel
Copy link
Contributor

@lajones - Everything going into dev now is 2.0.0 milestone. We already branched.

@lajones
Copy link
Contributor

lajones commented Apr 27, 2017

@smitpatel Sorry - selected wrong dropdown. Thx for fixing.

@bricelam bricelam modified the milestones: 2.0.0, 2.0.0-preview2 May 16, 2017
@bricelam bricelam added good first issue This issue should be relatively straightforward to fix. and removed good first issue This issue should be relatively straightforward to fix. labels May 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. good first issue This issue should be relatively straightforward to fix. help wanted This issue involves technologies where we are not experts. Expert help would be appreciated. type-bug
Projects
None yet
Development

No branches or pull requests

6 participants