Merge pull request #3616 from crobibero/migration-new-install
Allow migration to optionally run on fresh install
This commit is contained in:
commit
107cf21f26
|
@ -17,6 +17,11 @@ namespace Jellyfin.Server.Migrations
|
|||
/// </summary>
|
||||
public string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether to perform migration on a new install.
|
||||
/// </summary>
|
||||
public bool PerformOnNewInstall { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Execute the migration routine.
|
||||
/// </summary>
|
||||
|
|
|
@ -43,9 +43,8 @@ namespace Jellyfin.Server.Migrations
|
|||
// If startup wizard is not finished, this is a fresh install.
|
||||
// Don't run any migrations, just mark all of them as applied.
|
||||
logger.LogInformation("Marking all known migrations as applied because this is a fresh install");
|
||||
migrationOptions.Applied.AddRange(migrations.Select(m => (m.Id, m.Name)));
|
||||
migrationOptions.Applied.AddRange(migrations.Where(m => !m.PerformOnNewInstall).Select(m => (m.Id, m.Name)));
|
||||
host.ServerConfigurationManager.SaveConfiguration(MigrationsListStore.StoreKey, migrationOptions);
|
||||
return;
|
||||
}
|
||||
|
||||
var appliedMigrationIds = migrationOptions.Applied.Select(m => m.Id).ToHashSet();
|
||||
|
|
|
@ -32,6 +32,9 @@ namespace Jellyfin.Server.Migrations.Routines
|
|||
/// <inheritdoc/>
|
||||
public string Name => "AddDefaultPluginRepository";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool PerformOnNewInstall => true;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Perform()
|
||||
{
|
||||
|
|
|
@ -48,6 +48,9 @@ namespace Jellyfin.Server.Migrations.Routines
|
|||
/// <inheritdoc/>
|
||||
public string Name => "CreateLoggingConfigHeirarchy";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool PerformOnNewInstall => false;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Perform()
|
||||
{
|
||||
|
|
|
@ -25,6 +25,9 @@ namespace Jellyfin.Server.Migrations.Routines
|
|||
/// <inheritdoc/>
|
||||
public string Name => "DisableTranscodingThrottling";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool PerformOnNewInstall => false;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Perform()
|
||||
{
|
||||
|
|
|
@ -41,6 +41,9 @@ namespace Jellyfin.Server.Migrations.Routines
|
|||
/// <inheritdoc/>
|
||||
public string Name => "MigrateActivityLogDatabase";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool PerformOnNewInstall => false;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Perform()
|
||||
{
|
||||
|
|
|
@ -54,6 +54,9 @@ namespace Jellyfin.Server.Migrations.Routines
|
|||
/// <inheritdoc/>
|
||||
public string Name => "MigrateUserDatabase";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool PerformOnNewInstall => false;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Perform()
|
||||
{
|
||||
|
|
|
@ -29,6 +29,9 @@ namespace Jellyfin.Server.Migrations.Routines
|
|||
/// <inheritdoc/>
|
||||
public string Name => "RemoveDuplicateExtras";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool PerformOnNewInstall => false;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Perform()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user