From f4af78817d5832c11ff96f365714917fad0db4f9 Mon Sep 17 00:00:00 2001 From: Fernando Fernández Date: Mon, 6 Sep 2021 21:05:21 +0200 Subject: Move model configuration to its own classes --- .../ModelConfiguration/ApiKeyConfiguration.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Jellyfin.Server.Implementations/ModelConfiguration/ApiKeyConfiguration.cs (limited to 'Jellyfin.Server.Implementations/ModelConfiguration/ApiKeyConfiguration.cs') diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/ApiKeyConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/ApiKeyConfiguration.cs new file mode 100644 index 000000000..9067d3833 --- /dev/null +++ b/Jellyfin.Server.Implementations/ModelConfiguration/ApiKeyConfiguration.cs @@ -0,0 +1,22 @@ +using Jellyfin.Data.Entities.Security; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; + +namespace Jellyfin.Server.Implementations.ModelConfiguration +{ + /// + /// FluentAPI configuration for the ApiKey entity. + /// + public class ApiKeyConfiguration : IEntityTypeConfiguration + { + /// + public void Configure(EntityTypeBuilder builder) + { + // Indexes + + builder + .HasIndex(entity => entity.AccessToken) + .IsUnique(); + } + } +} -- cgit v1.2.3