-
Notifications
You must be signed in to change notification settings - Fork 80
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
[EF 7] Upgrading to beta 5 breaks migrations #35
Comments
Updated: Typo in |
O.o
|
@jsinh good catch. Fixed. |
After this change I have problem with ForeignKey. public virtual ForeignKeyBuilder ForeignKey([NotNullAttribute]string referencedEntityTypeName, [NotNullAttribute]params string[] propertyNames); And now we have: public virtual ForeignKey AddForeignKey([NotNullAttribute]Property property, [NotNullAttribute]Key principalKey, [CanBeNullAttribute]EntityType principalEntityType = null); How can I add new foreign key? |
@witek1902 Yes, the foreign key API also changed. I've upgraded the original comment above to include a note on fixing these: ⏫ |
When I run command to regenerate migration I get the following error Any idea to fix it ? I am running this command at a location where project.json file exists as shown below. I have added a new issue on dnx. The following is a link |
@mbharodia from initial inspection, no I am not sure how to fix this. Please create a question on Stack Overflow or a Github issue on dnx and update your comment above with a link. |
Fixed. Issue got Resolved after Installing Microsoft.AspNet.SignalR.Server 3.0.0-beta4 |
Oh... good to know. Thanks a lot for the heads up. |
I am using
When I run the command dnx . ef migration add Empty
my ef command is specified as so in project.json
How can I resolve this, thanks. |
Commands have changed slightly:
Hope this helps you. |
You know what it is, my
is not working at all, it is broken
Am I missing a dependency, here is my project.json list
Thank you for your help. |
I got ef working, EntityFramework7.Commands got renamed back to EntityFramework.Commands. So this fixed it.
|
@developer1998 are you using beta7? There has been a rename as per #51 |
@ph1ll that did it, thank you
Almost there... Now I am getting en error within the schema itself. Looks like I am missing a reference
|
Got it, referencing using Microsoft.Data.Entity.SqlServer.Metadata; solved it. Thank you so much for all the help. |
Entity Framework 7 projects that use migrations may encounter breaking changes when upgrading from beta4 to beta5.
Problems
ModelSnapshot
This error occurs when upgrading an application that used the beta 4 template and EntityFramework is upgraded to beta5.
Fix
To fix this error, delete the file
Migrations/ApplicationDbContextModelSnapshot.cs
. Regenerate the model snapshot by adding a new migration by running this command from the command prompt in the root folder of the MVC project.dnx . ef migration add Empty
.CreateIdentitySchema migration
A few errors make occur until
Migrations/000000_CreateIdentitySchema.cs
is changed to match the new Migration API.Fix
Modify
Migrations/000000_CreateIdentitySchema.cs
to match the new migrations API.Convert the Target property in the
CreateIdentitySchema
class to a methodRemove the instantiation of
new BasicModelBuilder()
and use instead theModelBuilder
instance passed into this method.The foreign key API has also changed. Fix the broken foreign key configuration using this pattern:
The text was updated successfully, but these errors were encountered: