Skip to content

Commit

Permalink
Merge pull request #165 from ethpandaops/pk910/fix-pgsql-issue
Browse files Browse the repository at this point in the history
fix insert query for consolidation request txs to pgsql
  • Loading branch information
pk910 authored Oct 30, 2024
2 parents d8aaf4e + e38b8b9 commit bded131
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion db/consolidation_request_txs.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func InsertConsolidationRequestTxs(consolidationTxs []*dbtypes.ConsolidationRequ
argIdx += fieldCount
}
fmt.Fprint(&sql, EngineQuery(map[dbtypes.DBEngineType]string{
dbtypes.DBEnginePgsql: " ON CONFLICT (block_number, block_index) DO UPDATE SET source_index = excluded.source_index, target_index = excluded.target_index, fork_id = excluded.fork_id",
dbtypes.DBEnginePgsql: " ON CONFLICT (block_root, block_index) DO UPDATE SET source_index = excluded.source_index, target_index = excluded.target_index, fork_id = excluded.fork_id",
dbtypes.DBEngineSqlite: "",
}))

Expand Down
2 changes: 1 addition & 1 deletion db/consolidation_requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func InsertConsolidationRequests(consolidations []*dbtypes.ConsolidationRequest,
argIdx += fieldCount
}
fmt.Fprint(&sql, EngineQuery(map[dbtypes.DBEngineType]string{
dbtypes.DBEnginePgsql: " ON CONFLICT (slot_index, slot_root) DO UPDATE SET orphaned = excluded.orphaned, fork_id = excluded.fork_id",
dbtypes.DBEnginePgsql: " ON CONFLICT (slot_root, slot_index) DO UPDATE SET orphaned = excluded.orphaned, fork_id = excluded.fork_id",
dbtypes.DBEngineSqlite: "",
}))
_, err := tx.Exec(sql.String(), args...)
Expand Down

0 comments on commit bded131

Please sign in to comment.