version-0.1 (#1)
Squash and merge of version-0.1 Co-authored-by: James Wampler <james@wamp.dev> Co-committed-by: James Wampler <james@wamp.dev>
This commit was merged in pull request #1.
This commit is contained in:
38
src/api/MicCheck.Api/Data/Configurations/ApiKeyConfiguration.cs
Normal file → Executable file
38
src/api/MicCheck.Api/Data/Configurations/ApiKeyConfiguration.cs
Normal file → Executable file
@@ -1,19 +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();
|
||||
}
|
||||
}
|
||||
using MicCheck.Api.Common.Security.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