mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-27 22:56:45 -04:00
Fixed: Add Validation for Import lists, Correct Language/Metadata profiles
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(14)]
|
||||
public class fix_language_metadata_profiles : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Execute.Sql("UPDATE artists SET metadataProfileId = " +
|
||||
"CASE WHEN ((SELECT COUNT(*) FROM metadataprofiles) > 0) " +
|
||||
"THEN (SELECT id FROM metadataprofiles ORDER BY id ASC LIMIT 1) " +
|
||||
"ELSE 0 END " +
|
||||
"WHERE artists.metadataProfileId == 0");
|
||||
|
||||
Execute.Sql("UPDATE artists SET languageProfileId = " +
|
||||
"CASE WHEN ((SELECT COUNT(*) FROM languageprofiles) > 0) " +
|
||||
"THEN (SELECT id FROM languageprofiles ORDER BY id ASC LIMIT 1) " +
|
||||
"ELSE 0 END " +
|
||||
"WHERE artists.languageProfileId == 0");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user