mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-26 08:13:09 -06:00
Fix conflict statements
This commit is contained in:
parent
dc056f7e40
commit
f858b5ac7c
|
|
@ -49,7 +49,7 @@ CREATE TABLE IF NOT EXISTS roomserver_state_block (
|
|||
const insertStateDataSQL = "" +
|
||||
"INSERT INTO roomserver_state_block (state_block_hash, event_nids)" +
|
||||
" VALUES ($1, $2)" +
|
||||
" ON CONFLICT (event_nids) DO UPDATE SET event_nids=$2" +
|
||||
" ON CONFLICT (state_block_hash) DO UPDATE SET event_nids=$2" +
|
||||
" RETURNING state_block_nid"
|
||||
|
||||
const bulkSelectStateBlockEntriesSQL = "" +
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ CREATE TABLE IF NOT EXISTS roomserver_state_snapshots (
|
|||
const insertStateSQL = "" +
|
||||
"INSERT INTO roomserver_state_snapshots (state_snapshot_hash, room_nid, state_block_nids)" +
|
||||
" VALUES ($1, $2, $3)" +
|
||||
" ON CONFLICT (room_nid, state_block_nids) DO UPDATE SET room_nid=$2" +
|
||||
" ON CONFLICT (state_snapshot_hash) DO UPDATE SET room_nid=$2" +
|
||||
// Performing an update, above, ensures that the RETURNING statement
|
||||
// below will always return a valid state snapshot ID
|
||||
" RETURNING state_snapshot_nid"
|
||||
|
|
|
|||
Loading…
Reference in a new issue