Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think the accepted answer is incorrect. There is a <a href="https://stackoverflow.com/questions/10171658/lose-ef-code-first-migration-when-working-on-different-tfs-branches">much better solution for handling entity framework migration merge conflicts</a> on a similar question.</p> <p>All you need to do after a merge is to re-scaffold the meta data of the migration in the target branch. That is you do not rescaffold the up/down code, just the state in the resx-file.</p> <pre><code>add-migration [the_migration_to_rescaffold_metadata_for] </code></pre> <p>This procedure will fail though if a different migration in the merge have changed the database in such a way that the migration is no longer runnable or gives an unexpected result. That being said - I belive that to be a very rare case as most migrations should be auto-generated, or at least not be dependent on other tables that are not changed in the migration itself as well. Very minor issue but one to be aware of.</p> <p>One such case could be fxp (I couldn't think of a better example)</p> <ul> <li><p>Column foo is an int and rows contain [0, 1, 2]</p></li> <li><p>Migration A from branch A change foo to boolean (0 will become false automatically and > 0 will become true)</p></li> <li><p>Migration B from branch B change foo to string. It expects it to be an int but it is a boolean, the migration will succeed though. Data will be lost since when migration B was created the rows would contain ["0", "1", "2"]. When migration A altered column to boolean (and did so successfully and with expected result) the rows will now contain ["0", "1", "1"] instead and Migration B will have a different end result than what was observed in Branch B.</p></li> </ul> <p>There are probably more edge cases where things could go wrong with the solution. But if migrations up/down code is not dependent on things changed by another migration in the merge it should work well to just update the metadata in the migrations.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload