Adding Flags API

This commit is contained in:
2026-04-07 15:30:40 -07:00
parent 7b15086fe5
commit 0ba076b650
78 changed files with 3862 additions and 81 deletions

View File

@@ -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();
}
}