mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-14 11:23:42 +02:00
63cf7a3b85
added monodevelop, siaodb files to git.ignore
52 lines
1.3 KiB
C#
52 lines
1.3 KiB
C#
using System;
|
|
using System.Data.Common;
|
|
using System.Data.SqlClient;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using Migrator.Framework;
|
|
using NzbDrone.Common;
|
|
|
|
namespace NzbDrone.Core.Datastore.Migrations
|
|
{
|
|
public abstract class NzbDroneMigration : Migration
|
|
{
|
|
protected virtual void MainDbUpgrade()
|
|
{
|
|
}
|
|
|
|
protected virtual void LogDbUpgrade()
|
|
{
|
|
}
|
|
|
|
public override void Up()
|
|
{
|
|
if (Database.ConnectionString.Contains(PathExtentions.NZBDRONE_SQLCE_DB_FILE))
|
|
{
|
|
MainDbUpgrade();
|
|
}
|
|
else if (Database.ConnectionString.Contains(PathExtentions.LOG_SQLCE_DB_FILE))
|
|
{
|
|
LogDbUpgrade();
|
|
}
|
|
else
|
|
{
|
|
LogDbUpgrade();
|
|
MainDbUpgrade();
|
|
}
|
|
}
|
|
|
|
protected IObjectDatabase GetObjectDb()
|
|
{
|
|
var sqlCeConnection = SqlCeProxy.EnsureDatabase(Database.ConnectionString);
|
|
|
|
var eqPath = sqlCeConnection.Database.Replace(".sdf", ".eq");
|
|
return new SiaqoDbFactory(new DiskProvider(),new EnvironmentProvider()).Create(eqPath);
|
|
}
|
|
|
|
public override void Down()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|