|
|
@ -1,9 +1,7 @@
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
using System.Configuration;
|
|
|
|
using System.Configuration;
|
|
|
|
using System.Data.Common;
|
|
|
|
using System.Data.Common;
|
|
|
|
using System.Data.EntityClient;
|
|
|
|
|
|
|
|
using System.Data.SqlServerCe;
|
|
|
|
using System.Data.SqlServerCe;
|
|
|
|
using MvcMiniProfiler;
|
|
|
|
|
|
|
|
using NzbDrone.Common;
|
|
|
|
using NzbDrone.Common;
|
|
|
|
using NzbDrone.Core.Instrumentation;
|
|
|
|
using NzbDrone.Core.Instrumentation;
|
|
|
|
using PetaPoco;
|
|
|
|
using PetaPoco;
|
|
|
@ -14,9 +12,9 @@ namespace NzbDrone.Core.Datastore
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private readonly EnviromentProvider _enviromentProvider;
|
|
|
|
private readonly EnviromentProvider _enviromentProvider;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static Connection()
|
|
|
|
public static void InitiFacotry()
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
Database.Mapper = new CustomeMapper();
|
|
|
|
|
|
|
|
|
|
|
|
var dataSet = ConfigurationManager.GetSection("system.data") as System.Data.DataSet;
|
|
|
|
var dataSet = ConfigurationManager.GetSection("system.data") as System.Data.DataSet;
|
|
|
|
dataSet.Tables[0].Rows.Add("Microsoft SQL Server Compact Data Provider 4.0"
|
|
|
|
dataSet.Tables[0].Rows.Add("Microsoft SQL Server Compact Data Provider 4.0"
|
|
|
@ -30,12 +28,6 @@ namespace NzbDrone.Core.Datastore
|
|
|
|
_enviromentProvider = enviromentProvider;
|
|
|
|
_enviromentProvider = enviromentProvider;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static Connection()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Database.Mapper = new CustomeMapper();
|
|
|
|
|
|
|
|
InitiFacotry();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String MainConnectionString
|
|
|
|
public String MainConnectionString
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get
|
|
|
|
get
|
|
|
@ -54,7 +46,6 @@ namespace NzbDrone.Core.Datastore
|
|
|
|
|
|
|
|
|
|
|
|
public static string GetConnectionString(string path)
|
|
|
|
public static string GetConnectionString(string path)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//return String.Format("Data Source={0};Version=3;Cache Size=30000;Pooling=true;Default Timeout=2", path);
|
|
|
|
|
|
|
|
return String.Format("Data Source={0}", path);
|
|
|
|
return String.Format("Data Source={0}", path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -73,8 +64,6 @@ namespace NzbDrone.Core.Datastore
|
|
|
|
return GetLogDbContext(LogConnectionString);
|
|
|
|
return GetLogDbContext(LogConnectionString);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static IDatabase GetPetaPocoDb(string connectionString, Boolean profiled = true)
|
|
|
|
public static IDatabase GetPetaPocoDb(string connectionString, Boolean profiled = true)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MigrationsHelper.Run(connectionString, true);
|
|
|
|
MigrationsHelper.Run(connectionString, true);
|
|
|
|