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

Subsequent migration creation after initial try to force cascade delete #3940

Closed
techyian opened this issue Dec 1, 2015 · 2 comments
Closed

Comments

@techyian
Copy link

techyian commented Dec 1, 2015

Hey,

I originally posted this issue in the Npgsql repo but I have also reproduced using the Sql Server provider for EF7. After upgrading to RC1 final, I've found that after doing my initial migration which creates OK, all other migrations created try to drop all my current foreign keys and create new ones as cascade on delete. I've tried forcing cascade restrict within my DbContext but that doesn't seem to make a difference. I can run the migration without issue, but then if I create a new migration, the same code is generated trying to drop foreign keys and I can't figure out what's causing it.

After creating these migrations, the ApplicationDbContextModelSnapshot does not recognise any changes, which I'm guessing may have something to do with it?

I can simply remove the code that's generated which is fine, but I'd like to find out whether this is an issue I've caused by wrongly setting up my relationships, or whether it's a bug. I haven't seen any other reports of this kind of problem yet?

The original issue raised on Npgsql's repo was 880.

Thanks,
Ian.

@rowanmiller
Copy link
Contributor

@bricelam are you already aware of this? Guess we aren't checking the cascade settings in the model differ.

@smitpatel
Copy link
Member

dupe of #3751

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

No branches or pull requests

4 participants