mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 10:47:08 -07:00
Replaced MigSharp with MigrationsDotNet
This commit is contained in:
parent
63023d447d
commit
46ec4fa3ba
11 changed files with 148 additions and 1503 deletions
|
@ -5,7 +5,6 @@ using System.Linq;
|
|||
using System.Reflection;
|
||||
using System.Text;
|
||||
using Migrator.Framework;
|
||||
using MigSharp;
|
||||
using NLog;
|
||||
using NzbDrone.Core.Repository;
|
||||
using NzbDrone.Core.Repository.Quality;
|
||||
|
@ -19,6 +18,8 @@ namespace NzbDrone.Core.Datastore
|
|||
{
|
||||
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
public static bool IsMigrated { get; private set; }
|
||||
|
||||
public static void Run(string connetionString, bool trace)
|
||||
{
|
||||
Logger.Info("Preparing run database migration");
|
||||
|
@ -51,20 +52,9 @@ namespace NzbDrone.Core.Datastore
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public static void MigrateDatabase(string connectionString)
|
||||
{
|
||||
var migrator = new MigSharp.Migrator(connectionString, ProviderNames.SQLite);
|
||||
migrator.MigrateAll(typeof(MigrationsHelper).Assembly);
|
||||
}
|
||||
|
||||
public static void ForceSubSonicMigration(IRepository repository)
|
||||
{
|
||||
repository.Single<Series>(1);
|
||||
repository.Single<Episode>(1);
|
||||
repository.Single<EpisodeFile>(1);
|
||||
repository.Single<QualityProfile>(1);
|
||||
repository.Single<History>(1);
|
||||
repository.Single<IndexerSetting>(1);
|
||||
repository.Single<SceneNameMapping>(1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue