mirror of
https://github.com/Prowlarr/Prowlarr
synced 2025-12-06 08:34:28 +01:00
Fix newznab redirect database migration
(cherry picked from commit f67bc52f85fa0677f4cda5b7b7dcb30dfe31468a)
This commit is contained in:
parent
e4fb36e08f
commit
0ef9f4c869
1 changed files with 1 additions and 9 deletions
|
|
@ -1,5 +1,3 @@
|
|||
using System.Data;
|
||||
using Dapper;
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
|
|
@ -10,13 +8,7 @@ public class newznab_indexers_enable_redirect : NzbDroneMigrationBase
|
|||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Execute.WithConnection(UpdateNewznabRedirectSetting);
|
||||
}
|
||||
|
||||
private void UpdateNewznabRedirectSetting(IDbConnection conn, IDbTransaction tran)
|
||||
{
|
||||
var updateSql = "UPDATE \"Indexers\" SET \"Redirect\" = @Redirect WHERE \"Implementation\" = 'Newznab' AND \"Redirect\" = false";
|
||||
conn.Execute(updateSql, new { Redirect = true }, transaction: tran);
|
||||
Update.Table("Indexers").Set(new { Redirect = true }).Where(new { Implementation = "Newznab", Redirect = false });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue