Files
zap-stream-api/NostrStreamer/Database/Configuration/UserConfiguration.cs
2024-08-28 10:21:28 +01:00

26 lines
672 B
C#

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace NostrStreamer.Database.Configuration;
public class UserConfiguration : IEntityTypeConfiguration<User>
{
public void Configure(EntityTypeBuilder<User> builder)
{
builder.HasKey(a => a.PubKey);
builder.Property(a => a.StreamKey)
.IsRequired();
builder.Property(a => a.Balance)
.IsRequired();
builder.Property(a => a.TosAccepted);
builder.Property(a => a.Version)
.IsRowVersion();
builder.Property(a => a.IsAdmin);
builder.Property(a => a.IsBlocked);
}
}