mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-12 16:50:10 +00:00
Fix importing with no existing system
This commit is contained in:
parent
c6905f4ca1
commit
a41e20a0a3
3 changed files with 11 additions and 3 deletions
|
|
@ -25,8 +25,10 @@ namespace PluralKit {
|
|||
}
|
||||
|
||||
public async Task Link(PKSystem system, ulong accountId) {
|
||||
// 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
|
||||
using (var conn = _conn.Obtain())
|
||||
await conn.ExecuteAsync("insert into accounts (uid, system) values (@Id, @SystemId)", new { Id = accountId, SystemId = system.Id });
|
||||
await conn.ExecuteAsync("insert into accounts (uid, system) values (@Id, @SystemId) on conflict do nothing", new { Id = accountId, SystemId = system.Id });
|
||||
}
|
||||
|
||||
public async Task Unlink(PKSystem system, ulong accountId) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue