|
|
@ -13,11 +13,13 @@ namespace NzbDrone.Core.Datastore.Migration
|
|
|
|
public class update_with_quality_converters : NzbDroneMigrationBase
|
|
|
|
public class update_with_quality_converters : NzbDroneMigrationBase
|
|
|
|
{
|
|
|
|
{
|
|
|
|
protected override void MainDbUpgrade()
|
|
|
|
protected override void MainDbUpgrade()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!Schema.Table("QualityProfiles").Column("Items").Exists())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Alter.Table("QualityProfiles").AddColumn("Items").AsString().Nullable();
|
|
|
|
Alter.Table("QualityProfiles").AddColumn("Items").AsString().Nullable();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Execute.WithConnection(ConvertQualityProfiles);
|
|
|
|
Execute.WithConnection(ConvertQualityProfiles);
|
|
|
|
|
|
|
|
|
|
|
|
Execute.WithConnection(ConvertQualityModels);
|
|
|
|
Execute.WithConnection(ConvertQualityModels);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -80,7 +82,12 @@ namespace NzbDrone.Core.Datastore.Migration
|
|
|
|
var id = qualityModelReader.GetInt32(0);
|
|
|
|
var id = qualityModelReader.GetInt32(0);
|
|
|
|
var qualityJson = qualityModelReader.GetString(1);
|
|
|
|
var qualityJson = qualityModelReader.GetString(1);
|
|
|
|
|
|
|
|
|
|
|
|
var quality = Json.Deserialize<QualityModel>(qualityJson);
|
|
|
|
QualityModel quality;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!Json.TryDeserialize<QualityModel>(qualityJson, out quality))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var qualityNewJson = qualityModelConverter.ToDB(quality);
|
|
|
|
var qualityNewJson = qualityModelConverter.ToDB(quality);
|
|
|
|
|
|
|
|
|
|
|
|