Skip to content

Updates to breaking changes - #4673

Merged
ajcvickers merged 3 commits into
mainfrom
240309_BreakMeBreakMe
Mar 10, 2024
Merged

ajcvickers merged 3 commits into
mainfrom
240309_BreakMeBreakMe

Conversation

@ajcvickers

Copy link
Copy Markdown
Contributor

Fixes #4608
Part of #4538
Fixes #4315
Fixes #4257
Fixes #4655
Fixes #4654

Fixes #4608
Part of #4538
Fixes #4315
Fixes #4257
Fixes #4655
Fixes #4654
@ajcvickers
ajcvickers force-pushed the 240309_BreakMeBreakMe branch from dd398c1 to 640acf0 Compare March 10, 2024 09:38
@ajcvickers
ajcvickers requested a review from a team March 10, 2024 09:40

@roji roji left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM


<a name="discriminators"></a>

### Discriminators now have a max length

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The main breaking change here is that EF 8.0 will generate a migration changing the discriminator column from nvarchar(max) to nvarchar(x), right? If so, I'd make it clear that this unexpected migration gets generated etc.

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.

That's not really the break we're trying to document. The migration is an appropriate way to manage the change. However, this is not the case when Migrations is not able to automatically make the change, such as when the column is part of an index, since the index would need to dropped and re-created, and EF doesn't do that, so it fails.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see, ok. It still may be worth explaining that an unexpected migration is created (and why) as background etc. But no big deal either way.

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.

Yeah, I added another sentence to that effect.

@ajcvickers
ajcvickers merged commit c19932c into main Mar 10, 2024
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Blog>()
.ToTable(tb => tb.UseSqlOutputClause(false));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ajcvickers we still only show the convention below for adding triggers to all tables (rather than using the new UseSqlOutputClause() mechanism) - I'm wondering whether we're missing functionality or something for doing UseSqlOutputClause() from a convention (or should we just doc it?)

@ajcvickers

Copy link
Copy Markdown
Contributor Author

@roji I asked @AndriySvyryd about this (I think on Teams) back when I did the PR. We're missing the APIs used for bulk config.

@roji

roji commented Mar 26, 2024

Copy link
Copy Markdown
Member

Ah OK, thanks for the clarification!

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

Labels

None yet

Projects

None yet

3 participants