mirror of https://github.com/lidarr/Lidarr
44 lines
1.0 KiB
C#
44 lines
1.0 KiB
C#
using System;
|
|
|
|
namespace NzbDrone.Core.Datastore.Migration.Framework
|
|
{
|
|
public abstract class NzbDroneMigrationBase : FluentMigrator.Migration
|
|
{
|
|
protected virtual void MainDbUpgrade()
|
|
{
|
|
}
|
|
|
|
protected virtual void LogDbUpgrade()
|
|
{
|
|
}
|
|
|
|
public override void Up()
|
|
{
|
|
var context = (MigrationContext)ApplicationContext;
|
|
|
|
SQLiteAlter = context.SQLiteAlter;
|
|
|
|
switch (context.MigrationType)
|
|
{
|
|
case MigrationType.Main:
|
|
MainDbUpgrade();
|
|
return;
|
|
case MigrationType.Log:
|
|
LogDbUpgrade();
|
|
return;
|
|
default:
|
|
LogDbUpgrade();
|
|
MainDbUpgrade();
|
|
return;
|
|
}
|
|
}
|
|
|
|
public ISQLiteAlter SQLiteAlter { get; private set; }
|
|
|
|
public override void Down()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|