7

How can I use MVC4 Migrations without using Entity Frameworks? I would really like to use data migrations but I am not using Entity Frameworks. I am using dapper-dot-net.

Jamey McElveen
  • 18,135
  • 25
  • 89
  • 129
  • 1
    It's a feature of Entity Framework, so you can't (as far as I know). You can use other tools to generate change scripts however, there are quite a bit of tools out there. – Leon Cullens Jun 07 '12 at 13:26

2 Answers2

9

Yes, you can use Migrations without using Entity Framework. All Migrations cares about is the metadata it uses to manage the database and you need to use some EF stuff to handle that, but you then don't ever need to use EF to actually access the database. This blog post describes the process in detail: http://weblogs.asp.net/fredriknormen/archive/2012/02/15/using-entity-framework-4-3-database-migration-for-any-project.aspx

Arthur Vickers
  • 7,503
  • 32
  • 26
3

Check out Insight.Database.Schema on NuGet. It gives you a lot of the magic of migrations without the hassle of EF. I'll be updating the docs on github over the next few days.

Jon Wagner
  • 667
  • 4
  • 6