// Licensed to Timothy Schenk under the GNU AGPL Version 3 License. using Continuity.AuthServer.DB.Documents; using JetBrains.Annotations; using Microsoft.EntityFrameworkCore; namespace Continuity.AuthServer.DB; public class WonderkingContext : DbContext { public WonderkingContext([NotNull] DbContextOptions options) : base(options) { } public DbSet Accounts { get; set; } public DbSet Characters { get; set; } public DbSet InventoryItems { get; set; } public DbSet Guilds { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.Entity(entity => { entity.HasIndex(e => e.Username).IsUnique(); entity.HasIndex(e => e.Id).IsUnique(); entity.Property(e => e.Id).HasColumnType("uuid"); }); } }