EF Code First Mysql to SQL Server

前端 未结 1 852
小鲜肉
小鲜肉 2021-01-21 18:27

I have an MVC 5 application that I first configured to use Mysql but now would like it to use SQL Server.

My app uses code first and migrations in order to generate the

相关标签:
1条回答
  • 2021-01-21 18:48

    You need to follow the below mentioned steps to overcome above issue.

    Step 1 : Use NuGet package to remove and install the relevant packages.This is very important.

    If it's not working after the above step then you have to follow the below mentioned steps.

    Step 1 : Get a backup of your project and SQL db and keep it in a safe place.

    Step 2 : After that you have to delete all your data migration scripts on your app.

    Step 3 : Delete the SQL db also.

    Step 4 : Recreate all your Migration scripts again and after that run those against the SQL server.

    Note : You need to do above steps b'cos it seems EF keep the provider details on the db migration scripts.

    0 讨论(0)
提交回复
热议问题