Lidarr/src/NzbDrone.Core/Datastore/Migration/006_separate_automatic_and_...

20 lines
704 B
C#

using FluentMigrator;
using NzbDrone.Core.Datastore.Migration.Framework;
namespace NzbDrone.Core.Datastore.Migration
{
[Migration(6)]
public class separate_automatic_and_interactive_search : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()
{
Rename.Column("EnableSearch").OnTable("Indexers").To("EnableAutomaticSearch");
Alter.Table("Indexers").AddColumn("EnableInteractiveSearch").AsBoolean().Nullable();
Execute.Sql("UPDATE \"Indexers\" SET \"EnableInteractiveSearch\" = \"EnableAutomaticSearch\"");
Alter.Table("Indexers").AlterColumn("EnableInteractiveSearch").AsBoolean().NotNullable();
}
}
}