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

Allow specifying ON UPDATE behavior #21563

Open
bricelam opened this issue Jul 8, 2020 · 7 comments
Open

Allow specifying ON UPDATE behavior #21563

bricelam opened this issue Jul 8, 2020 · 7 comments

Comments

@bricelam
Copy link
Contributor

bricelam commented Jul 8, 2020

modelBuilder.Entity<Post>()
    .HasOne(p => p.Blog).WithMany(b => b.Posts)
        .OnUpdate(UpdateBehavior.Cascade);

Without this, any behavior specified in Migrations is lost when a table gets rebuilt.

This is loosely related to #4073, but can be done independently.

@TonyValenti
Copy link

Hi @ajcvickers - I wanted to add my vote to this. We could really use this feature. For us, we'll be modifying the key values by hand but it would be really nice if EFCore could create the key relationships with cascade update so that we wouldn't have to modify all our keys in SQL Server.

@roji
Copy link
Member

roji commented Sep 2, 2021

@TonyValenti to vote, please do 👍 on the top-most post.

@TonyValenti
Copy link

Thanks! Voted!

@SoftCircuits
Copy link

How has this not received more votes? Do people not know about this forum?

@DanteMarshal
Copy link

Bump 👀 2024

@NastouhGit
Copy link

Please add this, I don't like change all times for all table changed migration file!
Maybe I want to delete file and regenerate again many times!

@darcome
Copy link

darcome commented Jul 28, 2024

Any update on this? As a MariaDb and MySql user, this feature would be very useful, especially if the primary key is sort of self-speaking and may be changed in the future.

I know that this may be a code smell, but if you inherit the db and is not worth changing the ddl, this feature is very useful.

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

No branches or pull requests

8 participants