Files
Govor/Govor.Data/Configurations/UserPushTokenConfiguration.cs
T
2026-03-01 16:48:06 +07:00

18 lines
594 B
C#

using Govor.Core.Models.Users;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace Govor.Data.Configurations;
public class UserPushTokenConfiguration : IEntityTypeConfiguration<UserPushToken>
{
public void Configure(EntityTypeBuilder<UserPushToken> builder)
{
builder.HasKey(t => t.Id);
builder.HasIndex(x => x.Token).IsUnique();
builder.HasIndex(x => x.UserSessionId).IsUnique();
builder.HasIndex(x => x.UserId).IsUnique();
builder.HasIndex(x => new { x.UserId, x.IsActive });
}
}