mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 16:55:37 +02:00
Merging this prematurely to make sure the team is on the same boat... like dang! We need to find a better way to do this. Plus it has become too big
18 lines
528 B
C#
18 lines
528 B
C#
using Microsoft.EntityFrameworkCore;
|
|
|
|
public class SteamDbContext : DbContext
|
|
{
|
|
public DbSet<SteamUserCredential> SteamUserCredentials { get; set; }
|
|
|
|
public SteamDbContext(DbContextOptions<SteamDbContext> options) : base(options)
|
|
{
|
|
}
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
// Create a unique index on TeamId and UserId
|
|
modelBuilder.Entity<SteamUserCredential>()
|
|
.HasIndex(c => new { c.TeamId, c.UserId })
|
|
.IsUnique();
|
|
}
|
|
} |