I've setup a .net core api app to host JWT token authentication using an asp identity database. That part works great. My problem is when I go to add custom classes, every migration I perform is trying to create the AspNet* tables again even though they exist. The migration is aware of my custom class (Test) and wants to create it, but the script it's trying to run dies on the AspNetRoles table (already exists error).
I create a new migration:
Add-Migration NewMigration
Then update:
Update-Database
Here is my ApplicationDBContext.cs
:
public class ApplicationDBContext : IdentityDbContext<ApplicationUser>
{
public ApplicationDBContext(DbContextOptions<ApplicationDBContext> options) : base(options)
{
}
// This is my custom class
public DbSet<Test> Test { get; set; }
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
}
}
I'm at a loss. I just need to do migrations and have EF Core ignore the AspNet identity tables.
Edit: Here is ApplicationUser.cs
public class ApplicationUser : IdentityUser
{
}
Migrations folder: