fix(import): add AddAccount to tx

This commit is contained in:
spiral
2021-10-06 20:24:29 -04:00
parent 655d0d6c44
commit 2e89310129
4 changed files with 14 additions and 3 deletions

View File

@@ -88,7 +88,7 @@ namespace PluralKit.Core
return _db.QueryFirst<PKSystem>(conn, query, extraSql: "returning *");
}
public Task AddAccount(SystemId system, ulong accountId)
public Task AddAccount(SystemId system, ulong accountId, IPKConnection? conn = null)
{
// We have "on conflict do nothing" since linking an account when it's already linked to the same system is idempotent
// This is used in import/export, although the pk;link command checks for this case beforehand
@@ -100,7 +100,7 @@ namespace PluralKit.Core
});
_logger.Information("Linked account {UserId} to {SystemId}", accountId, system);
return _db.ExecuteQuery(query, extraSql: "on conflict do nothing");
return _db.ExecuteQuery(conn, query, extraSql: "on conflict do nothing");
}
public async Task RemoveAccount(SystemId system, ulong accountId)