none
What is the binary data created during an Entity Framework migration? RRS feed

  • Question

  • Hi,

    VS2013 update 3

    Using the Package Manager Console, the command "update-database -verbose" shows the SQL script for the update, followed by binary data.  What is the binary data and where does it come from?

    Thanks.

    Best Regards,

    Alan

    Sunday, November 2, 2014 8:46 PM

Answers

  • Hello Alan,

    >>What is the binary data and where does it come from?

    If you mean the binary data stored in the Model column of the _MigrationHistory table, it actually represents the .edmx file in the code first model. Entity Framework would create a zipped edmx file according to the code first model and serialize it to the binary data and store it to the Model column. If you want, you can get the edmx file according that data in the Model column by following this article:

    http://www.tecsupra.com/how-to-decode-the-model-column-of-the-migrationhistory-table-in-ef-migrations/

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Alan Wheeler Friday, November 7, 2014 7:19 PM
    Monday, November 3, 2014 6:27 AM
    Moderator

All replies

  • Could you provide an example?

    Please mark as answer, if this was it. Visit my SQL Server Compact blog http://erikej.blogspot.com

    Sunday, November 2, 2014 11:12 PM
  • Hello Alan,

    >>What is the binary data and where does it come from?

    If you mean the binary data stored in the Model column of the _MigrationHistory table, it actually represents the .edmx file in the code first model. Entity Framework would create a zipped edmx file according to the code first model and serialize it to the binary data and store it to the Model column. If you want, you can get the edmx file according that data in the Model column by following this article:

    http://www.tecsupra.com/how-to-decode-the-model-column-of-the-migrationhistory-table-in-ef-migrations/

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Alan Wheeler Friday, November 7, 2014 7:19 PM
    Monday, November 3, 2014 6:27 AM
    Moderator
  • Hi Fred,

    Wow, that was just too cool.

    I will admit when I went to the link, I was a little intimidated, but I followed those steps and lo and behold I had an entity framework diagram (I had to change the extension of the output file to .edmx, but it worked!

    I wondered how I could go about 'seeing' what my code first database looked like without going into SSMS.  Very cool.

    Thanks so much.

    Best Regards,

    Alan

    Friday, November 7, 2014 7:25 PM