Continuous Integration with EF Code First Migrations

Viewed 3447

I was wondering if I could automate completely code first migrations for continuous integration.

Currently my continuous integration simply simply updates the code changes, however, I manually generate a migration, and update the database on my continuous integration server.

Is it reliable / possible / recommended to generate the migrations and update the database automatically?

For example:

I have user with property userId and username. I then add a property age into the code. Current scenario would require me to create a migration that will capture this change, and then I check in my changes to the version control. The continuous integration will spot this change, and will deploy the new version. I have to manually update-database (which should be automated).

Can I skip out the generation of migration too, such that I can simply add the property age onto the code, and the continuous integration will generate this migration. Not sure if this is recommended.

2 Answers
Related