Skip to content

Commit

Permalink
add field to insert_ queries
Browse files Browse the repository at this point in the history
  • Loading branch information
jillxuu committed Jul 1, 2024
1 parent 509f237 commit d2e1cea
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rust/processor/src/processors/token_v2_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,11 @@ fn insert_collections_v2_query(
diesel::insert_into(schema::collections_v2::table)
.values(items_to_insert)
.on_conflict((transaction_version, write_set_change_index))
.do_nothing(),
.do_update()
.set((
collection_properties.eq(excluded(collection_properties)),
inserted_at.eq(excluded(inserted_at)),
)),
None,
)
}
Expand Down Expand Up @@ -354,6 +358,7 @@ fn insert_current_collections_v2_query(
table_handle_v1.eq(excluded(table_handle_v1)),
token_standard.eq(excluded(token_standard)),
last_transaction_version.eq(excluded(last_transaction_version)),
collection_properties.eq(excluded(collection_properties)),
last_transaction_timestamp.eq(excluded(last_transaction_timestamp)),
inserted_at.eq(excluded(inserted_at)),
)),
Expand Down

0 comments on commit d2e1cea

Please sign in to comment.