EF architecture ~ Execution sequence of Migration data Migration, efmigration

Source: Internet
Author: User

EF architecture ~ Execution sequence of Migration data Migration, efmigration

For a single branch project, as long as you generate a version of migration, there will be a corresponding timestamp file, and in the update-database, it will start from the minimum time, execute until the current version of migration. for multiple branch projects, it involves adding your own migration plan on each branch. In this case, we may manually modify the timestamp, to adapt to the migration of our database!

The figure above shows A complex data migration project, which comes from multiple branch projects. When appropriate, there may be 32, 35, and 36 on Branch A, while Branch B may have, 34, after we merge branch A to Branch B, we need to modify the original Branch B, because the dates of your 33 and 34 may be before 35 and 36. At this time, during code generation, the version may be lost, resulting in incomplete database structure. Therefore, we need to modify the migration timestamp file according to the code production time!

Execution order: execute in the order of time, rather than by name!

Production Code: Update-Database-Script-SourceMigration: $ InitialDatabase-TargetMigration: init39

Thank you for reading this article!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.