mirror of
https://github.com/Prowlarr/Prowlarr
synced 2025-12-15 13:07:27 +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 FluentMigrator;
|
||||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||||
|
|
||||||
|
|
@ -10,13 +8,7 @@ public class newznab_indexers_enable_redirect : NzbDroneMigrationBase
|
||||||
{
|
{
|
||||||
protected override void MainDbUpgrade()
|
protected override void MainDbUpgrade()
|
||||||
{
|
{
|
||||||
Execute.WithConnection(UpdateNewznabRedirectSetting);
|
Update.Table("Indexers").Set(new { Redirect = true }).Where(new { Implementation = "Newznab", Redirect = false });
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue