Q: Deleted local database tables using SSMS and can't recreate it with ASP.NET Entitiy Framework I've been a bit gung ho and deleted my database tables using SQL Server Management Studio (SSMS) and deleted all the migrations manually too.
The database is local and was for testing purposes only. How can I create the tables again with Entity Framework?
If it involves a lot of work am I better starting a fresh ASP.NET app and copying across my code?

A: If you want to start with one fresh migration because you didn't deploy your app yet, you can:

*

*Remove the Migrations directory including its snapshot and migration files.

*Create a new migration: dotnet ef migrations add Initial

*Update your database: dotnet ef database update
This will generate one migration and initalize the database according to the current state of your entities.

If you only deleted your database but still have your migrations, getting a fresh one is as simple as:

dotnet ef database update


