diff --git a/roomserver/storage/postgres/deltas/20210416150927_state_blocks_refactor.go b/roomserver/storage/postgres/deltas/20210416150927_state_blocks_refactor.go index cd4ceb06..b1cfe7d3 100644 --- a/roomserver/storage/postgres/deltas/20210416150927_state_blocks_refactor.go +++ b/roomserver/storage/postgres/deltas/20210416150927_state_blocks_refactor.go @@ -169,11 +169,11 @@ func UpStateBlocksRefactor(tx *sql.Tx) error { return fmt.Errorf("tx.QueryRow.Scan (insert new snapshot): %w", err) } - _, err = tx.Exec(`UPDATE roomserver_events SET state_snapshot_nid=$1 WHERE state_snapshot_nid=$2`, newsnapshot, snapshot) + _, err = tx.Exec(`UPDATE roomserver_events SET state_snapshot_nid=$1 WHERE state_snapshot_nid=$2`, newsnapshot, snapshot.StateSnapshotNID) if err != nil { return fmt.Errorf("tx.Exec (update events): %w", err) } - _, err = tx.Exec(`UPDATE roomserver_rooms SET state_snapshot_nid=$1 WHERE state_snapshot_nid=$2`, newsnapshot, snapshot) + _, err = tx.Exec(`UPDATE roomserver_rooms SET state_snapshot_nid=$1 WHERE state_snapshot_nid=$2`, newsnapshot, snapshot.StateSnapshotNID) if err != nil { return fmt.Errorf("tx.Exec (update rooms): %w", err) }