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

Change value generation defaults for numeric keys when using TPC #28529

Merged
merged 1 commit into from
Jul 28, 2022

Conversation

ajcvickers
Copy link
Member

Fixes #28096

  • Default for relational providers is Never
  • Warning is generated by default for relational providers if OnAdd is set
  • SQL Server sets the default to OnAdd with the Sequence strategy

Fixes #28096

Default for relational providers is `Never`
Warning is generated by default for relational providers if `OnAdd` is set
SQL Server sets the default to `OnAdd` with the `Sequence` strategy
@ajcvickers ajcvickers requested a review from a team July 27, 2022 22:52
@ajcvickers
Copy link
Member Author

/cc @roji @lauxjpn

@ajcvickers
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ajcvickers ajcvickers merged commit 62509f8 into main Jul 28, 2022
@ajcvickers ajcvickers deleted the RideTheWorm0726 branch July 28, 2022 18:10
roji added a commit to roji/efcore.pg that referenced this pull request Jul 29, 2022
roji added a commit to roji/efcore.pg that referenced this pull request Jul 29, 2022
@roji
Copy link
Member

roji commented Jul 29, 2022

PG implementation: npgsql/efcore.pg#2456

roji added a commit to npgsql/efcore.pg that referenced this pull request Jul 29, 2022
@ilmax
Copy link
Contributor

ilmax commented Aug 16, 2023

Hey @ajcvickers, @roji does this one also take into account primary key that use value converters to unwrap an numeric value? (i.e. when you have a EntityId class that only wraps an int)

It doesn't seems to be working for me and I have to manually opt-in. Not a big deal but it would be nice if that can be either called out on the docs or done by default.
If you want I can open a tracking issue (I wasn't able to find an existing one)

@ajcvickers
Copy link
Member Author

@ilmax Properties of types that wrap a primary key value of some other type are never marked as generated by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support sequence key generation on SQL Server, which is useful for Table-per-concrete-type (TPC) mappings
4 participants