Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9322863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T04:12:03+00:00 2026-06-19T04:12:03+00:00

I enabled migrations for my entity framework application. Now, i want to update my

  • 0

I enabled migrations for my entity framework application. Now, i want to update my database on my remote server. I ran this command:

PM> Update-Database -Script 

So it generated a sql script. But, this script has all the metadata that I actually have in my database, and not the changes that were made; so, when I try to run this sql script on my remote server, it says that tables already exists.

How can i generate sql script, that will contain only necessary updates?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T04:12:05+00:00Added an answer on June 19, 2026 at 4:12 am

    You can target a specific migration for this. If you have a migration called Foo, for example:

    Update-Database -TargetMigration Foo -Script
    

    It will generate a migration script for the Foo migration. Replace Foo with whatever migration you need to run on that server.

    Add-Migration InitialMigration
    Add-Migration AddCustomers
    Add-Migration AddProjects
    

    Let’s say you have the above three migrations in your project, and your local database has all of them applied, but the remote database only has InitialMigration. You can run the following:

    Update-Database -SourceMigration InitialMigration -TargetMigration AddProjects -Script
    

    This will apply two migrations on the remote server (AddCustomers and AddProjects).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Entity Framework 5 in a project, and I've got Migrations enabled. Here's
I've enabled code-first migrations on my entity framework project, and have added several migrations
I am trying to use Entity Framework data migrations, as described in this post
We are running Entity Framework 5 with Code First and Migrations Enabled . Running
I'm new to MVC 4 and entity framework and when I run this command
I upgraded a project to Entity Framework 4.3 and enabled migrations on the project.
From Migrations.cs, I want to disable one module if it is enabled, and enable
Subject: Migrating very complex, legacy client-server application to SAS enabled web-version using NOSQL We
I can type Update-Database , Enable-Migrations etc, from Package Manager Console and it works
How do I enable Entity Framework 5 (version 5.0.0) migrations for multiple DB contexts

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.