refactored Migrations

This commit is contained in:
kay.one 2011-06-04 11:19:22 -07:00
commit a1653022ad
4 changed files with 21 additions and 70 deletions

View file

@ -56,7 +56,7 @@ namespace NzbDrone.Core
LogConfiguration.Setup();
Migrations.Run();
Migrations.Run(Connection.MainConnectionString);
ForceMigration(_kernel.Get<IRepository>());
SetupDefaultQualityProfiles(_kernel.Get<IRepository>()); //Setup the default QualityProfiles on start-up
@ -97,9 +97,9 @@ namespace NzbDrone.Core
_kernel.Bind<WebTimer>().ToSelf().InSingletonScope();
_kernel.Bind<AutoConfigureProvider>().ToSelf().InSingletonScope();
_kernel.Bind<IRepository>().ToConstant(Connection.MainDataRepository).InSingletonScope();
_kernel.Bind<IRepository>().ToConstant(Connection.LogDataRepository).WhenInjectedInto<SubsonicTarget>().InSingletonScope();
_kernel.Bind<IRepository>().ToConstant(Connection.LogDataRepository).WhenInjectedInto<LogProvider>().InSingletonScope();
_kernel.Bind<IRepository>().ToConstant(Connection.CreateSimpleRepository(Connection.MainConnectionString)).InSingletonScope();
_kernel.Bind<IRepository>().ToConstant(Connection.CreateSimpleRepository(Connection.LogConnectionString)).WhenInjectedInto<SubsonicTarget>().InSingletonScope();
_kernel.Bind<IRepository>().ToConstant(Connection.CreateSimpleRepository(Connection.LogConnectionString)).WhenInjectedInto<LogProvider>().InSingletonScope();
}
}