Skip to content

Differentiate between a sequence's database schema and model schema - #28943

Merged
bricelam merged 1 commit into
dotnet:release/7.0from
bricelam:seqsch
Sep 2, 2022
Merged

bricelam merged 1 commit into
dotnet:release/7.0from
bricelam:seqsch

Conversation

@bricelam

Copy link
Copy Markdown
Contributor

Fixes #28223

@bricelam
bricelam requested a review from AndriySvyryd August 31, 2022 23:28

SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);

modelBuilder.HasSequence(""EntityFrameworkHiLoSequence"", ""dbo"")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before this change, we wouldn't scaffold the schema here causing two sequences to be added to the model (the other by UseHiLo)

@AndriySvyryd

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@bricelam
bricelam merged commit 3c6b0d3 into dotnet:release/7.0 Sep 2, 2022
@bricelam
bricelam deleted the seqsch branch September 2, 2022 17:53
@dogahasdemir

Copy link
Copy Markdown

Hi,

Is there any update about this matter? After switching from EF Core 5.0 to EF Core 7.0, our migrations started to try drop the non existing Sequence "EntityFrameworkHiLoSequence" which is the default Sequence coming from EF Core library itself.
We do not specify anydefault schema for the model.

Thanks

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HiLo sequences are being dropped when specifying a default schema

3 participants