Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From my experience that suggests that migration table is out of sync (even if your data isn't), and that's been part of the db schema now (since 4.3 I think - under system tables). </p> <p>There could be many reasons and ways to experience that error , but most of the time... </p> <p>The problematic part is some combination of manually backing/restoring the full database with code changes alongside - I'm not entirely certain as to why always. </p> <p>In short, even if Db-s are the same migration table data might not be - and hash comparison may fail (still full restore sounds like good enough - but you have 'two sides'). </p> <hr> <p>What works for me is to use<br> <code>Update-Database -Script</code> </p> <p>That creates a script with a 'migration difference',<br> which you can manually apply as an SQL script on the target server database (and you should get the right migration table rows inserted etc.). </p> <p>If that still doesn't work - you can still do two things... </p> <ol> <li><p>Remove the migration table (target - under system tables) - as per <a href="http://blogs.msdn.com/b/adonet/archive/2012/02/09/ef-4-3-automatic-migrations-walkthrough.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/b/adonet/archive/2012/02/09/ef-4-3-automatic-migrations-walkthrough.aspx</a> comments in there - that should fail back to previous behavior and if you're certain that your Db-s are the same - it's just going to 'trust you', </p></li> <li><p>As a last resort I used - make a <code>Update-Database -Script</code> of the full schema (e.g. by initializing an empty db which should force a 'full script'),<br> find the <code>INSERT INTO [__MigrationHistory]</code> records,<br> just run those, insert them into the database,<br> and make sure that your databases - and code match,</p></li> </ol> <p>that should make things run in sync again. </p> <p>(disclaimer: this is not a bullet proof to work at all times, you may need to try a few things given your local scenarios - but should get you in sync)</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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