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

After fail of EnsureCreatedAsync method database will be in inconsistent state. Why we are not using transaction? #3908

Closed
SychevIgor opened this issue Nov 27, 2015 · 1 comment
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@SychevIgor
Copy link

Hello,
I'm not sure that it's a bug, but at least some unexpected behavior.

In our code we are using something like that.
using (var db = serviceProvider.GetService())
{
var databaseCreated = await db.Database.EnsureCreatedAsync();
}
as a result of this call we catch an exception with text "{"Introducing FOREIGN KEY constraint 'FK_Ride_Driver_DriverId' on table 'Ride' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.\r\nCould not create constraint or index. See previous errors."}"

I would expect that database as a result will be empty, but in fact it was partially creates.

@rowanmiller rowanmiller added this to the 7.0.0 milestone Dec 1, 2015
@rowanmiller rowanmiller modified the milestones: 7.0.0-rc2, 7.0.0 Dec 2, 2015
@renattomachado
Copy link

I'm with the same problem!

@bricelam bricelam modified the milestones: 7.0.0-rc2, 7.0.0 Dec 14, 2015
@ajcvickers ajcvickers modified the milestones: 1.0.0-rc2, 1.0.0 Oct 15, 2022
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

5 participants