2012-01-15 05:47:13 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
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()
|
|
|
|
|
{
|
2013-02-04 01:27:34 +00:00
|
|
|
|
if (Database.ConnectionString.Contains(PathExtentions.NZBDRONE_SQLCE_DB_FILE))
|
2012-01-15 05:47:13 +00:00
|
|
|
|
{
|
|
|
|
|
MainDbUpgrade();
|
|
|
|
|
}
|
2013-02-04 01:27:34 +00:00
|
|
|
|
else if (Database.ConnectionString.Contains(PathExtentions.LOG_SQLCE_DB_FILE))
|
2012-01-15 05:47:13 +00:00
|
|
|
|
{
|
|
|
|
|
LogDbUpgrade();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
LogDbUpgrade();
|
|
|
|
|
MainDbUpgrade();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override void Down()
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|