Reputation: 302
I would like to reset Entity Framework migrations as if I had never used this functionality.
I tried to :
Add-Migration Initial
The result is :
namespace fretapp.Migrations
{
public partial class Test : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
}
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
I deleted all the tables from my database, but the models in API are still here, so It should update the database, but no code here.
Then I tried to :
So where are the data from migrations stored???
Thank you in advance.
Upvotes: 1
Views: 2503
Reputation: 1
You can undo all the migration by using the below command.
Update-Database -Target:0
Or you run the below command
Update-Database <First MigrationName>
so all the migration will be undone, then you can make the changes and generate the new migration and proceed with the work.
Upvotes: 1