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

Identity property configuration #11924

Closed
vorenus181 opened this issue May 7, 2018 · 2 comments · Fixed by #14721
Closed

Identity property configuration #11924

vorenus181 opened this issue May 7, 2018 · 2 comments · Fixed by #14721
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-enhancement
Milestone

Comments

@vorenus181
Copy link

vorenus181 commented May 7, 2018

There is no way to configure initial value of identity column. EF should allow to add additional property configuration to produce sql like this:

CREATE TABLE exmaple (
Id int IDENTITY(1000, 1)
...

Further technical details

EF Core version: 2.1 preview 2
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Windows 10 Home
IDE: Visual Studio 2017 15.6.3

@ajcvickers ajcvickers added this to the Backlog milestone May 7, 2018
@ajcvickers ajcvickers added type-enhancement help wanted This issue involves technologies where we are not experts. Expert help would be appreciated. labels May 7, 2018
@ajcvickers
Copy link
Member

Note that there are a couple of parts to this:

  • Update of the Migrations API to allow Identity configuration to be specified without dropping down to raw SQL. This is likely a relatively small change.
  • Add a SQL Server-specific extension method to specify this configuration such that:
    • It aligns with the conventions and specifications for Identity columns
    • It flows through to Migrations such that the API covered in the first point is used when a new migration is scaffolded.

@Muppets
Copy link
Contributor

Muppets commented Feb 16, 2019

@ajcvickers I've raised a PR to add the support for it. I've only covered the basic scenario of specifying the seed and increment in UseSqlServerIdentityColumn call.

If I understand your details above, I'm missing the scaffolding support for these two parameters on migrations. Any pointers on where to look for that, and what that would look like?

@bricelam bricelam modified the milestones: Backlog, 3.0.0 Apr 18, 2019
@bricelam bricelam added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Apr 18, 2019
@bricelam bricelam self-assigned this Apr 18, 2019
@ajcvickers ajcvickers modified the milestones: 3.0.0, 3.0.0-preview5 Apr 22, 2019
@bricelam bricelam added the good first issue This issue should be relatively straightforward to fix. label May 31, 2019
@ajcvickers ajcvickers modified the milestones: 3.0.0-preview5, 3.0.0 Nov 11, 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-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants