Database migrations for Entity Framework 4

前端 未结 5 1556
面向向阳花
面向向阳花 2020-12-14 04:06

I\'ve been playing with Entity Framework 4, using the model driven approach to generate the database script from my entities. This is great but I\'m not sure how this works

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-14 04:38

    Well, if you want to work like ActiveRecord, then you need to work like ActiveRecord. :)

    However, if you want to use model-first but still use migrations, this will be possible, but will require extra work on your behalf. Model-first will generate a database change script. You will have to extract the relevant parts into migrations, as well as manually writing undo scripts. Although this involves some manual labor, it doesn't strike me as terribly difficult.

提交回复
热议问题