From 12a900b8f63341d5c8e6834a9f4333235af48571 Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Fri, 29 May 2020 15:16:17 -0400 Subject: [PATCH] Update schema and migration to allow LastLoginDate and LastActivityDate to be null --- ...Designer.cs => 20200529171409_AddUsers.Designer.cs} | 10 ++++------ ...27010628_AddUsers.cs => 20200529171409_AddUsers.cs} | 9 +++------ .../Migrations/JellyfinDbModelSnapshot.cs | 4 ++-- 3 files changed, 9 insertions(+), 14 deletions(-) rename Jellyfin.Server.Implementations/Migrations/{20200527010628_AddUsers.Designer.cs => 20200529171409_AddUsers.Designer.cs} (98%) rename Jellyfin.Server.Implementations/Migrations/{20200527010628_AddUsers.cs => 20200529171409_AddUsers.cs} (99%) diff --git a/Jellyfin.Server.Implementations/Migrations/20200527010628_AddUsers.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20200529171409_AddUsers.Designer.cs similarity index 98% rename from Jellyfin.Server.Implementations/Migrations/20200527010628_AddUsers.Designer.cs rename to Jellyfin.Server.Implementations/Migrations/20200529171409_AddUsers.Designer.cs index e0321dfa78..e2558ffc44 100644 --- a/Jellyfin.Server.Implementations/Migrations/20200527010628_AddUsers.Designer.cs +++ b/Jellyfin.Server.Implementations/Migrations/20200529171409_AddUsers.Designer.cs @@ -1,6 +1,4 @@ -#pragma warning disable CS1591 - -// +// using System; using Jellyfin.Server.Implementations; using Microsoft.EntityFrameworkCore; @@ -11,7 +9,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Jellyfin.Server.Implementations.Migrations { [DbContext(typeof(JellyfinDb))] - [Migration("20200527010628_AddUsers")] + [Migration("20200529171409_AddUsers")] partial class AddUsers { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -281,10 +279,10 @@ namespace Jellyfin.Server.Implementations.Migrations b.Property("InvalidLoginAttemptCount") .HasColumnType("INTEGER"); - b.Property("LastActivityDate") + b.Property("LastActivityDate") .HasColumnType("TEXT"); - b.Property("LastLoginDate") + b.Property("LastLoginDate") .HasColumnType("TEXT"); b.Property("LoginAttemptsBeforeLockout") diff --git a/Jellyfin.Server.Implementations/Migrations/20200527010628_AddUsers.cs b/Jellyfin.Server.Implementations/Migrations/20200529171409_AddUsers.cs similarity index 99% rename from Jellyfin.Server.Implementations/Migrations/20200527010628_AddUsers.cs rename to Jellyfin.Server.Implementations/Migrations/20200529171409_AddUsers.cs index 0157e668d4..166d9dbb50 100644 --- a/Jellyfin.Server.Implementations/Migrations/20200527010628_AddUsers.cs +++ b/Jellyfin.Server.Implementations/Migrations/20200529171409_AddUsers.cs @@ -1,7 +1,4 @@ -#pragma warning disable CS1591 -#pragma warning disable SA1601 - -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Jellyfin.Server.Implementations.Migrations @@ -39,8 +36,8 @@ namespace Jellyfin.Server.Implementations.Migrations AuthenticationProviderId = table.Column(maxLength: 255, nullable: false), PasswordResetProviderId = table.Column(maxLength: 255, nullable: false), InvalidLoginAttemptCount = table.Column(nullable: false), - LastActivityDate = table.Column(nullable: false), - LastLoginDate = table.Column(nullable: false), + LastActivityDate = table.Column(nullable: true), + LastLoginDate = table.Column(nullable: true), LoginAttemptsBeforeLockout = table.Column(nullable: true), SubtitleMode = table.Column(nullable: false), PlayDefaultAudioTrack = table.Column(nullable: false), diff --git a/Jellyfin.Server.Implementations/Migrations/JellyfinDbModelSnapshot.cs b/Jellyfin.Server.Implementations/Migrations/JellyfinDbModelSnapshot.cs index 0494744c79..9a2315802a 100644 --- a/Jellyfin.Server.Implementations/Migrations/JellyfinDbModelSnapshot.cs +++ b/Jellyfin.Server.Implementations/Migrations/JellyfinDbModelSnapshot.cs @@ -277,10 +277,10 @@ namespace Jellyfin.Server.Implementations.Migrations b.Property("InvalidLoginAttemptCount") .HasColumnType("INTEGER"); - b.Property("LastActivityDate") + b.Property("LastActivityDate") .HasColumnType("TEXT"); - b.Property("LastLoginDate") + b.Property("LastLoginDate") .HasColumnType("TEXT"); b.Property("LoginAttemptsBeforeLockout")