Fixed: Migrations on SQLite 3.41.0

This commit is contained in:
Mark McDowall 2023-03-05 22:28:55 -08:00
parent e4c0e80e3e
commit d185783987
2 changed files with 6 additions and 1 deletions

View File

@ -36,7 +36,7 @@ namespace NzbDrone.Core.Datastore.Migration
removeFailedDownloads = false; removeFailedDownloads = false;
} }
using (var updateClientCmd = conn.CreateCommand(tran, $"UPDATE DownloadClients SET RemoveCompletedDownloads = (CASE WHEN Implementation IN (\"RTorrent\", \"Flood\") THEN 0 ELSE ? END), RemoveFailedDownloads = ?")) using (var updateClientCmd = conn.CreateCommand(tran, $"UPDATE DownloadClients SET RemoveCompletedDownloads = (CASE WHEN Implementation IN ('RTorrent', 'Flood') THEN 0 ELSE ? END), RemoveFailedDownloads = ?"))
{ {
updateClientCmd.AddParameter(removeCompletedDownloads ? 1 : 0); updateClientCmd.AddParameter(removeCompletedDownloads ? 1 : 0);
updateClientCmd.AddParameter(removeFailedDownloads ? 1 : 0); updateClientCmd.AddParameter(removeFailedDownloads ? 1 : 0);

View File

@ -23,6 +23,11 @@ namespace NzbDrone.Core.Datastore.Migration.Framework
public override bool SupportsTransactions => true; public override bool SupportsTransactions => true;
public override bool TableExists(string schemaName, string tableName)
{
return Exists("select count(*) from sqlite_master where name='{0}' and type='table'", tableName);
}
public override void Process(AlterColumnExpression expression) public override void Process(AlterColumnExpression expression)
{ {
var tableDefinition = GetTableSchema(expression.TableName); var tableDefinition = GetTableSchema(expression.TableName);