2019-02-23 22:39:11 +00:00
|
|
|
using FluentMigrator;
|
|
|
|
using NzbDrone.Core.Datastore.Migration.Framework;
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Datastore.Migration
|
|
|
|
{
|
2019-10-05 18:34:34 +00:00
|
|
|
[Migration(26)]
|
2019-02-23 22:39:11 +00:00
|
|
|
public class rename_quality_profiles_add_upgrade_allowed : NzbDroneMigrationBase
|
|
|
|
{
|
|
|
|
protected override void MainDbUpgrade()
|
|
|
|
{
|
|
|
|
Rename.Table("Profiles").To("QualityProfiles");
|
|
|
|
|
2022-01-26 00:08:27 +00:00
|
|
|
Alter.Table("QualityProfiles").AddColumn("UpgradeAllowed").AsBoolean().Nullable();
|
|
|
|
Alter.Table("LanguageProfiles").AddColumn("UpgradeAllowed").AsBoolean().Nullable();
|
2019-02-23 22:39:11 +00:00
|
|
|
|
|
|
|
// Set upgrade allowed for existing profiles (default will be false for new profiles)
|
|
|
|
Update.Table("QualityProfiles").Set(new { UpgradeAllowed = true }).AllRows();
|
|
|
|
Update.Table("LanguageProfiles").Set(new { UpgradeAllowed = true }).AllRows();
|
|
|
|
|
|
|
|
Rename.Column("ProfileId").OnTable("Artists").To("QualityProfileId");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|