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 7909221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:18:59+00:00 2026-06-03T12:18:59+00:00

We are using TFS and have different branches for our Dev. in the branch

  • 0

We are using TFS and have different branches for our Dev.

  1. in the branch A we made a migration to change a column size

  2. in the branch B we made a migration to add a new table. This branch doesn not know about the branch A modification !!

  3. both modification are merged to the main branch.

When I do an update database, it does the 2 migration but at the end tells me there is pending changes. If I do an Add-Migration, it creates the same as the 1st migration (in branch A).

Unable to update database to match the current model because there are pending
changes and automatic migration is disabled. Either write the pending model
changes to a code-based migration or enable automatic migration. Set
DbMigrationsConfiguration.AutomaticMigrationsEnabled to true to enable automatic
migration.
You can use the Add-Migration command to write the pending model changes to a
code-based migration.

Is it because something is missing in the content of the property Target de IMigrationMetadata of my last migration since it didn’t know about the 1st one ?

Is it possible to handle migrations in different TFS branches?

  • 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-03T12:19:15+00:00Added an answer on June 3, 2026 at 12:19 pm

    An EF migration step contains a metadata file, that has a signature of the model that is the result of the migration step. The problem when merging is that the signature of the migration done in branch B doesn’t include the stuff done in the migration in branch A. As long as the migrations are in the branches, this is correct. When merging it becomes wrong.

    To remedy it, you have to regenerate the meta-data of the latter migration with

    add-migration MyMigrationName
    

    Running add-migration on an existing migration without the -force parameter will regenerate just the metadata.

    I wrote an in depth walk-through of a merging scenario in the EF Migrations and a Merge Conflict post on my blog.

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

Sidebar

Related Questions

Using TFS, we have the following: A main baseline A development branch for each
Right now, we have a small team of developers using TFS for our version
Is it possible when using TFS server to automatically have it ensure a specific
We are using TFS build and we have a couple of custom steps within
We're using TFS with MSF for Agile 4.2 on a project, and I have
I'm using MSBuild with TFS and I have to build 4 solutions. When the
We're using TFS as version control system for our software. Currently the software has
I have a question about Workspaces on TFS. Currently, I am using TFS 2008
I have an MsBuild file which shells out to TFS using tf.exe for a
We have a TFS team project using the Agile process template. We have added

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.