using Database.Entities; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Diagnostics; namespace Database; public class ApplicationContext(DbContextOptions options) : IdentityDbContext, Guid, IdentityUserClaim, IdentityUserRole, IdentityUserLogin, IdentityRoleClaim, IdentityUserToken>(options) { public DbSet Admonitions { get; set; } public DbSet Alliances { get; set; } public DbSet DesertStorms { get; set; } public DbSet MarshalGuards { get; set; } public DbSet Notes { get; set; } public DbSet Players { get; set; } public DbSet Ranks { get; set; } public DbSet VsDuels { get; set; } public DbSet CustomEvents { get; set; } public DbSet MarshalGuardParticipants { get; set; } public DbSet VsDuelParticipants { get; set; } public DbSet CustomEventParticipants { get; set; } public DbSet DesertStormParticipants { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { base.OnConfiguring(optionsBuilder); optionsBuilder.ConfigureWarnings(warnings => warnings.Ignore(RelationalEventId.PendingModelChangesWarning)); } protected override void OnModelCreating(ModelBuilder builder) { base.OnModelCreating(builder); builder.HasDefaultSchema("dbo"); builder.Entity(entity => { entity.ToTable(name: "Users"); }); builder.Entity>(entity => entity.ToTable(name: "Roles")); builder.Entity>(entity => entity.ToTable(name: "UserRoles")); builder.Entity>(entity => entity.ToTable(name: "RoleClaims")); builder.Entity>(entity => entity.ToTable(name: "UserLogins")); builder.Entity>(entity => entity.ToTable(name: "UserTokens")); builder.Entity>(entity => entity.ToTable(name: "UserClaims")); builder.ApplyConfigurationsFromAssembly(typeof(ApplicationContext).Assembly); } }