aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Migrations/IUpdater.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Jellyfin.Server/Migrations/IUpdater.cs')
-rw-r--r--Jellyfin.Server/Migrations/IUpdater.cs26
1 files changed, 26 insertions, 0 deletions
diff --git a/Jellyfin.Server/Migrations/IUpdater.cs b/Jellyfin.Server/Migrations/IUpdater.cs
new file mode 100644
index 000000000..60d970256
--- /dev/null
+++ b/Jellyfin.Server/Migrations/IUpdater.cs
@@ -0,0 +1,26 @@
+using System;
+using Microsoft.Extensions.Logging;
+
+namespace Jellyfin.Server.Migrations
+{
+ /// <summary>
+ /// Interface that descibes a migration routine.
+ /// </summary>
+ internal interface IUpdater
+ {
+ /// <summary>
+ /// Gets maximum version this Updater applies to.
+ /// If current version is greater or equal to it, skip the updater.
+ /// </summary>
+ public abstract Version Maximum { get; }
+
+ /// <summary>
+ /// Execute the migration from version "from".
+ /// </summary>
+ /// <param name="host">Host that hosts current version.</param>
+ /// <param name="logger">Host logger.</param>
+ /// <param name="from">Version to migrate from.</param>
+ /// <returns>Whether configuration was changed.</returns>
+ public abstract bool Perform(CoreAppHost host, ILogger logger, Version from);
+ }
+}