Lets say you have created a model to the existing database and then you want to update the database to reflect the new changes. When you type Update-Database you will get the below error.
Code-First Migration in Entity Framework has two important commands and they are :
1. Add-Migration : It will scaffold the next migration for the changes you have made to your domain classes.
2. Update-Database: It will apply pending changes to the database based on latest scaffolding colde file you have created using 'Add-Migration' command.
To solve this error we need to scaffold the next migration for the changes using the command Add-Migration as shown below :
Next we will again run the command Update-Database which will update the database as per your new models.
Please Like and Share the Blog, if you find it interesting and helpful.
- How to Integrate CKEditor in Asp Net Web Application
- Integrate Colorbox in Asp Net Web Application
- 10 Interview Questions on Nodejs
- Print Screen in Asp Net Web Application
- Handle Mouse Events in jQuery
- 5 Tips for Beginner Nodejs Developers
- How to receive data from the Querystring in Nodejs
- Macros for Visual Studio 2012 and 2013
- Raddish : New Node.js framework