File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ func (ci *BlockIndexer) saveData(
2626) error {
2727 return ci .db .Transaction (func (tx * gorm.DB ) error {
2828 if len (data .Blocks ) != 0 {
29- err := tx .Clauses (clause.OnConflict { DoNothing : true }).
29+ err := tx .Clauses (clause.Insert { Modifier : "IGNORE" }).
3030 CreateInBatches (data .Blocks , database .DBTransactionBatchesSize ).
3131 Error
3232 if err != nil {
@@ -36,7 +36,7 @@ func (ci *BlockIndexer) saveData(
3636
3737 if len (data .Transactions ) != 0 {
3838 // insert transactions in the database, if an entry already exists, do nothing
39- err := tx .Clauses (clause.OnConflict { DoNothing : true }).
39+ err := tx .Clauses (clause.Insert { Modifier : "IGNORE" }).
4040 CreateInBatches (data .Transactions , database .DBTransactionBatchesSize ).
4141 Error
4242 if err != nil {
@@ -46,7 +46,7 @@ func (ci *BlockIndexer) saveData(
4646
4747 if len (data .Logs ) != 0 {
4848 // insert logs in the database, if an entry already exists, do nothing
49- err := tx .Clauses (clause.OnConflict { DoNothing : true }).
49+ err := tx .Clauses (clause.Insert { Modifier : "IGNORE" }).
5050 CreateInBatches (data .Logs , database .DBTransactionBatchesSize ).
5151 Error
5252 if err != nil {
You can’t perform that action at this time.
0 commit comments