unique index auf user.name
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Design;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
@@ -43,10 +45,16 @@ namespace ReallifeGamemode.Database.Models
|
||||
.HasIndex(b => b.BusinessId)
|
||||
.IsUnique(true);
|
||||
|
||||
modelBuilder.Entity<Entities.User>()
|
||||
.HasIndex(u => u.BusinessId)
|
||||
modelBuilder.Entity<Entities.User>(e =>
|
||||
{
|
||||
e.HasIndex(u => u.BusinessId)
|
||||
.IsUnique(true);
|
||||
|
||||
e.HasIndex(u => u.Name)
|
||||
.IsUnique(true);
|
||||
});
|
||||
|
||||
|
||||
modelBuilder.Entity<Entities.ServerVehicle>()
|
||||
.Property(sv => sv.Active)
|
||||
.HasDefaultValue(true);
|
||||
|
||||
Reference in New Issue
Block a user