eventuate-examples / eventuate-tram-core-dotnet-examples-customers-and-orders

Apache License 2.0
42 stars 22 forks source link

should Database.EnsureCreated() be used if Database.Migrate() is being used.???? #8

Open cer opened 4 years ago

cer commented 4 years ago

https://github.com/eventuate-examples/eventuate-tram-core-dotnet-examples-customers-and-orders/blob/a5b7065bab554c30017b8532302edf9db5397b87/CustomerService/DBContext/CustomerContext.cs#L14

From the docs for Database.Migrate():

Note that this API is mutually exclusive with DbContext.Database.EnsureCreated(). EnsureCreated does not use migrations
///         to create the database and therefore the database that is created cannot be later updated using migrations.
charansingh83sh commented 4 years ago

Yes EnsureCreated does not work with migrations. I was using Database.EnsureCreated() before implementing Database Migrations and Forgot to remove this after implementing Migrations. Sorry for that. I have removed it now. https://github.com/eventuate-examples/eventuate-tram-core-dotnet-examples-customers-and-orders/pull/10/commits/4fd5628fe8579248b1715a6ac7a62495972d308e