Code First - thoughts on db migration RRS feed

  • General discussion

  • I know that database schema change in EF 4.1 Code First is still an open question. Here is what I came up with based on my so far limited understanding of the framework.

    1, I start with domain model and database initializers. The database gets dropped and recreated all the time when the model changes.

    2. Once users start banging the system and I don't want to deal SSIS import/export anymore I start using EF Code First Power Tools CTP. What this does is generates fluent mapping code which I have to merge with mine. From this point forward it is all manual - if I need to add entity, I'll do it in the code.

    Is this the right way to do it?



    Wednesday, June 8, 2011 12:36 PM

All replies

  • Hi Stan,


    You are right.

    The EF Power Tools can genrate Code First from an existing database, if you want to add entity, you should drop and recreate the database.

    Have a nice day.

    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, June 9, 2011 2:51 AM