Adding Flags API
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using MicCheck.Api.ApiKeys;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace MicCheck.Api.Data.Configurations;
|
||||
|
||||
public class ApiKeyConfiguration : IEntityTypeConfiguration<ApiKey>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<ApiKey> builder)
|
||||
{
|
||||
builder.HasKey(k => k.Id);
|
||||
builder.Property(k => k.Key).HasMaxLength(512).IsRequired();
|
||||
builder.Property(k => k.Prefix).HasMaxLength(8).IsRequired();
|
||||
builder.Property(k => k.Name).HasMaxLength(200).IsRequired();
|
||||
builder.Property(k => k.CreatedAt).IsRequired();
|
||||
|
||||
builder.HasIndex(k => k.Key).IsUnique();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user