diff options
| author | Fernando Fernández <ferferga@hotmail.com> | 2021-09-06 21:05:21 +0200 |
|---|---|---|
| committer | Fernando Fernández <ferferga@hotmail.com> | 2021-09-06 21:15:31 +0200 |
| commit | f4af78817d5832c11ff96f365714917fad0db4f9 (patch) | |
| tree | b00c18f5133386e962d087e910fbaf5b72eeb001 /Jellyfin.Server.Implementations/ModelConfiguration/ApiKeyConfiguration.cs | |
| parent | c2652d21e1da0c39e91b8a5dea21c4de1fea3f9d (diff) | |
Move model configuration to its own classes
Diffstat (limited to 'Jellyfin.Server.Implementations/ModelConfiguration/ApiKeyConfiguration.cs')
| -rw-r--r-- | Jellyfin.Server.Implementations/ModelConfiguration/ApiKeyConfiguration.cs | 22 |
1 files changed, 22 insertions, 0 deletions
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 +{ + /// <summary> + /// FluentAPI configuration for the ApiKey entity. + /// </summary> + public class ApiKeyConfiguration : IEntityTypeConfiguration<ApiKey> + { + /// <inheritdoc/> + public void Configure(EntityTypeBuilder<ApiKey> builder) + { + // Indexes + + builder + .HasIndex(entity => entity.AccessToken) + .IsUnique(); + } + } +} |
