mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-12 16:50:10 +00:00
Add a command for backdating switches
This commit is contained in:
parent
acb11dd9d6
commit
26d89136b1
4 changed files with 85 additions and 2 deletions
|
|
@ -214,6 +214,11 @@ async def add_switch(conn, system_id: int):
|
|||
res = await conn.fetchrow("insert into switches (system) values ($1) returning *", system_id)
|
||||
return res["id"]
|
||||
|
||||
@db_wrap
|
||||
async def move_last_switch(conn, system_id: int, switch_id: int, new_time):
|
||||
logger.debug("Moving latest switch (system={}, id={}, new_time={})".format(system_id, switch_id, new_time))
|
||||
await conn.execute("update switches set timestamp = $1 where system = $2 and id = $3", new_time, system_id, switch_id)
|
||||
|
||||
@db_wrap
|
||||
async def add_switch_member(conn, switch_id: int, member_id: int):
|
||||
logger.debug("Adding switch member (switch={}, member={})".format(switch_id, member_id))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue