You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Sonarr/src/NzbDrone.Core/Datastore/Migration/044_fix_xbmc_episode_metada...

28 lines
1007 B

using FluentMigrator;
using NzbDrone.Core.Datastore.Migration.Framework;
namespace NzbDrone.Core.Datastore.Migration
{
[Migration(44)]
public class fix_xbmc_episode_metadata : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()
{
// Convert Episode Metadata to proper type
Execute.Sql("UPDATE \"MetadataFiles\" " +
"SET \"Type\" = 2 " +
"WHERE \"Consumer\" = 'XbmcMetadata' " +
"AND \"EpisodeFileId\" IS NOT NULL " +
"AND \"Type\" = 4 " +
"AND \"RelativePath\" LIKE '%.nfo'");
// Convert Episode Images to proper type
Execute.Sql("UPDATE \"MetadataFiles\" " +
"SET \"Type\" = 5 " +
"WHERE \"Consumer\" = 'XbmcMetadata' " +
"AND \"EpisodeFileId\" IS NOT NULL " +
"AND \"Type\" = 4");
}
}
}