I was applying an update-database command. suddenly an error popped up that Aspnetroles table already exist. Note that I have deleted several times the migration folder in the project. I have understood the entity framework is trying to apply all my previous migrations. then I checked my [dbo].[__EFMigrationsHistory] table and it was empty as shown as picture https://i.imgur.com/ed2jm8b.png
I have already tried deleting migration folder and drop all tables in the database. but it runs the first migration, creates the tables and does not keep any trace in migration history table in the database
another point that would be helpful that when I delete the migration folder and enter command enable-migrations then it gives warning me with yellow background:
Enable-Migrations is obsolete. Use Add-Migration to start using Migrations.
EF core does not use
Enable-Migration any more.You need to use below code if you would like to add migrations:
Add-Migration MigrationName Update-Database