Dreamwalker
Dreamwalker

Reputation: 3035

How to trigger migration with entity framework

I want to trigger database migration through code to latest version.

I have already configured the migrations and they work fine but the only way I can get them to migrate is by querying the database which I think shouldn't be needed.

I am sure I have just missed something in the documentation to trigger the migration but if someone can point me in the right direction it will be much appreciated.

Upvotes: 0

Views: 1190

Answers (1)

Dreamwalker
Dreamwalker

Reputation: 3035

I found a related article that answered this all I need to do is call Database.Initialize(false); in my routine to upgrade the database.

Entity framework 4.3 run migrations at application start

Upvotes: 1

Related Questions