Skip to content

Commit

Permalink
convertFlappingRows(): fix foreign key error history -> flapping_history
Browse files Browse the repository at this point in the history
Don't INSERT IGNORE everything, then UPSERT everything. Instead INSERT IGNORE
flapping_history, UPSERT flapping_history and finally INSERT IGNORE history.
  • Loading branch information
Al2Klimov committed Dec 19, 2022
1 parent b9c5aff commit 8f8d2e7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cmd/icingadb-migrate/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -522,10 +522,13 @@ func convertFlappingRows(
}
}

stages = []icingaDbOutputStage{{
inserts: [][]contracts.Entity{flappingHistory, allHistory},
upserts: [][]contracts.Entity{flappingHistoryUpserts},
}}
stages = []icingaDbOutputStage{
{
inserts: [][]contracts.Entity{flappingHistory},
upserts: [][]contracts.Entity{flappingHistoryUpserts},
},
{inserts: [][]contracts.Entity{allHistory}},
}
return
}

Expand Down

0 comments on commit 8f8d2e7

Please sign in to comment.