Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable migration in Entity Framework 4.3.1?

Is there any way to disable migration in Entity Framework 4.3.1? I removed the migrations folder from the project and the generated tables in my database, but it doesn't work! How can you remove the migration?

like image 607
amiry jd Avatar asked Mar 14 '12 14:03

amiry jd


People also ask

Can I use EF core without migration?

Hi @PanagiotisKanavos, as you mentioned, it does not require migration.


Video Answer


2 Answers

If you don't want to use migrations but in the same time you want EF to create database for you, you just need to set correct database initializer:

Database.SetInitializer<YourContextType>(new CreateDatabaseIfNotExists<YourContentType>()); 
like image 136
Ladislav Mrnka Avatar answered Sep 27 '22 22:09

Ladislav Mrnka


Deleting the Migrations folder has worked for me. I don't get any errors, it puts me back to where I started.

like image 45
Noel Avatar answered Sep 27 '22 23:09

Noel