mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-27 22:56:45 -04:00
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:
@@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user