Added our own custom migrations, a lot easier to migrate DB versions now.

This commit is contained in:
tidusjar 2016-10-22 20:38:05 +01:00
commit 6e3339ad3c
16 changed files with 492 additions and 30 deletions

View file

@ -32,6 +32,7 @@ using Nancy.Authentication.Forms;
using Ninject.Modules;
using PlexRequests.Core;
using PlexRequests.Core.Migration;
using PlexRequests.Helpers;
using PlexRequests.Services.Interfaces;
using PlexRequests.Services.Notification;
@ -47,6 +48,7 @@ namespace PlexRequests.UI.NinjectModules
Bind<ISqliteConfiguration>().To<DbConfiguration>().WithConstructorArgument("provider", new SqliteFactory());
Bind<IPlexDatabase>().To<PlexDatabase>().WithConstructorArgument("provider", new SqliteFactory());
Bind<IPlexReadOnlyDatabase>().To<PlexReadOnlyDatabase>();
Bind<IMigrationRunner>().To<MigrationRunner>();
Bind<IUserMapper>().To<UserMapper>();

View file

@ -754,6 +754,10 @@
<Project>{8CB8D235-2674-442D-9C6A-35FCAEEB160D}</Project>
<Name>PlexRequests.Api</Name>
</ProjectReference>
<ProjectReference Include="..\PlexRequests.Core.Migration\PlexRequests.Core.Migration.csproj">
<Project>{8406EE57-D533-47C0-9302-C6B5F8C31E55}</Project>
<Name>PlexRequests.Core.Migration</Name>
</ProjectReference>
<ProjectReference Include="..\PlexRequests.Core\PlexRequests.Core.csproj">
<Project>{DD7DC444-D3BF-4027-8AB9-EFC71F5EC581}</Project>
<Name>PlexRequests.Core</Name>

View file

@ -32,6 +32,7 @@ using Ninject.Planning.Bindings.Resolvers;
using NLog;
using Owin;
using PlexRequests.Core.Migration;
using PlexRequests.Services.Jobs;
using PlexRequests.UI.Helpers;
using PlexRequests.UI.Jobs;
@ -67,6 +68,10 @@ namespace PlexRequests.UI
Debug.WriteLine("Finished bootstrapper");
var scheduler = new Scheduler();
scheduler.StartScheduler();
var runner = kernel.Get<IMigrationRunner>();
runner.MigrateToLatest();
}
catch (Exception exception)
{