2019-12-18 02:17:47 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using FluentMigrator;
|
|
|
|
|
using Marr.Data.QGen;
|
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
using NzbDrone.Common.Extensions;
|
|
|
|
|
using NzbDrone.Common.Serializer;
|
2018-08-05 14:28:05 +00:00
|
|
|
|
using NzbDrone.Core.Datastore.Migration.Framework;
|
2019-12-18 02:17:47 +00:00
|
|
|
|
using NzbDrone.Core.Qualities;
|
2018-08-05 14:28:05 +00:00
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Datastore.Migration
|
|
|
|
|
{
|
|
|
|
|
[Migration(147)]
|
|
|
|
|
public class add_custom_formats : NzbDroneMigrationBase
|
|
|
|
|
{
|
|
|
|
|
protected override void MainDbUpgrade()
|
|
|
|
|
{
|
|
|
|
|
//Execute.WithConnection(RenameUrlToBaseUrl);
|
|
|
|
|
Create.TableForModel("CustomFormats")
|
|
|
|
|
.WithColumn("Name").AsString().Unique()
|
|
|
|
|
.WithColumn("FormatTags").AsString();
|
|
|
|
|
|
|
|
|
|
Alter.Table("Profiles").AddColumn("FormatItems").AsString().WithDefaultValue("[{format:0, allowed:true}]").AddColumn("FormatCutoff").AsInt32().WithDefaultValue(0);
|
|
|
|
|
|
|
|
|
|
Execute.WithConnection(AddCustomFormatsToProfile);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void AddCustomFormatsToProfile(IDbConnection conn, IDbTransaction tran)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|