Quantcast
Channel: Visual Studio and Visual Web Developer Express
Viewing all articles
Browse latest Browse all 3509

NuGet Package Manager Console generate queries not only for pending but also for previous updated DB changes also in MVC 5 application

$
0
0

Hi,

I am working on an ASP.NET MVC 5 Razor application with Code First approach. I do the database updates in my test platform through NuGet Package Manager Console using the following command-

update-database -script -SourceMigration 0

If I am not wrong, I above command should generate a database queries for the pending updates without applying the changes to database and then I need to run the queries on my database. The problem in my case is-

  1. The above command apply the update database when I run it on NuGet Package Manager Console and generate the queries.
  2. The above command generate the queries not only for pending database changes, but also for previous updates which are already available in database.

So, when I move my code from development to test platform and run the queries on test database, it generates error because most of the things are already in the test database

I have no idea why it is happening, any idea how to resolve it?

Thanks in advance.


Viewing all articles
Browse latest Browse all 3509

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>