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 --- .../DeviceOptionsConfiguration.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Jellyfin.Server.Implementations/ModelConfiguration/DeviceOptionsConfiguration.cs (limited to 'Jellyfin.Server.Implementations/ModelConfiguration/DeviceOptionsConfiguration.cs') diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/DeviceOptionsConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/DeviceOptionsConfiguration.cs new file mode 100644 index 000000000..0db1944b5 --- /dev/null +++ b/Jellyfin.Server.Implementations/ModelConfiguration/DeviceOptionsConfiguration.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 DeviceOptions entity. + /// + public class DeviceOptionsConfiguration : IEntityTypeConfiguration + { + /// + public void Configure(EntityTypeBuilder builder) + { + // Indexes + + builder + .HasIndex(entity => entity.DeviceId) + .IsUnique(); + } + } +} -- cgit v1.2.3