Refactor ExtraFile/MetadataFile Services (#104)

* Preliminary Work for Extras for Music

* DB Migration for ExtraFiles, Other Cleanup

* More Extras Work, Add Album Metadata Type

* Update Housekeeps for Music Extras

* Fix HouseKeeper and add new Tests

* Final round of Cleanup
This commit is contained in:
Qstick
2017-10-16 21:40:31 -04:00
committed by GitHub
parent 4016d359ac
commit 38cbb2114f
43 changed files with 985 additions and 841 deletions
@@ -0,0 +1,44 @@
using FluentMigrator;
using NzbDrone.Core.Datastore.Migration.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NzbDrone.Core.Datastore.Migration
{
[Migration(123)]
public class music_extras : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()
{
Alter.Table("ExtraFiles")
.AddColumn("ArtistId").AsInt32().NotNullable().WithDefaultValue(0)
.AddColumn("AlbumId").AsInt32().NotNullable().WithDefaultValue(0)
.AddColumn("TrackFileId").AsInt32().NotNullable().WithDefaultValue(0);
Delete.Column("SeriesId").FromTable("ExtraFiles");
Delete.Column("SeasonNumber").FromTable("ExtraFiles");
Delete.Column("EpisodeFileId").FromTable("ExtraFiles");
Alter.Table("SubtitleFiles")
.AddColumn("ArtistId").AsInt32().NotNullable().WithDefaultValue(0)
.AddColumn("AlbumId").AsInt32().NotNullable().WithDefaultValue(0)
.AddColumn("TrackFileId").AsInt32().NotNullable().WithDefaultValue(0);
Delete.Column("SeriesId").FromTable("SubtitleFiles");
Delete.Column("SeasonNumber").FromTable("SubtitleFiles");
Delete.Column("EpisodeFileId").FromTable("SubtitleFiles");
Alter.Table("MetadataFiles")
.AddColumn("ArtistId").AsInt32().NotNullable().WithDefaultValue(0)
.AddColumn("AlbumId").AsInt32().Nullable()
.AddColumn("TrackFileId").AsInt32().Nullable();
Delete.Column("SeriesId").FromTable("MetadataFiles");
Delete.Column("SeasonNumber").FromTable("MetadataFiles");
Delete.Column("EpisodeFileId").FromTable("MetadataFiles");
}
}
}