mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
Migrations
Still need to remove System.Data.Sqlite, prefer an option in OrmLite to pluralize table names.
This commit is contained in:
parent
b9fac94eca
commit
4bb4faf626
29 changed files with 375 additions and 50 deletions
|
@ -23,8 +23,7 @@ namespace NzbDrone.Core
|
|||
containerBuilder.RegisterAssembly("NzbDrone.Core");
|
||||
|
||||
containerBuilder.InitDatabase();
|
||||
|
||||
|
||||
|
||||
containerBuilder.RegisterModule<LogInjectionModule>();
|
||||
}
|
||||
|
||||
|
@ -53,22 +52,16 @@ namespace NzbDrone.Core
|
|||
{
|
||||
logger.Info("Registering Database...");
|
||||
|
||||
var appDataPath = new EnvironmentProvider().GetAppDataPath();
|
||||
var environmentProvider = new EnvironmentProvider();
|
||||
var appDataPath = environmentProvider.GetAppDataPath();
|
||||
if (!Directory.Exists(appDataPath)) Directory.CreateDirectory(appDataPath);
|
||||
|
||||
container.Register(c =>
|
||||
{
|
||||
return c.Resolve<IDbFactory>().Create();
|
||||
return c.Resolve<IDbFactory>().Create(environmentProvider.GetNzbDroneDatabase());
|
||||
}).As<IDbConnection>().SingleInstance();
|
||||
|
||||
|
||||
container.Register(c =>
|
||||
{
|
||||
return c.Resolve<IDbFactory>().Create();
|
||||
}).As<IDbConnection>().SingleInstance();
|
||||
|
||||
container.RegisterGeneric(typeof(BasicRepository<>)).As(typeof(IBasicRepository<>));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue