Add a command for backdating switches
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user