File tree Expand file tree Collapse file tree 2 files changed +2
-0
lines changed Expand file tree Collapse file tree 2 files changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -437,6 +437,7 @@ def build_insert_sql(insert) # :nodoc:
437
437
sql << " ON CONFLICT #{ insert . conflict_target } DO NOTHING"
438
438
elsif insert . update_duplicates?
439
439
sql << " ON CONFLICT #{ insert . conflict_target } DO UPDATE SET "
440
+ sql << insert . touch_model_timestamps_unless { |column | "#{ insert . model . quoted_table_name } .#{ column } IS NOT DISTINCT FROM excluded.#{ column } " }
440
441
sql << insert . updatable_columns . map { |column | "#{ column } =excluded.#{ column } " } . join ( "," )
441
442
end
442
443
Original file line number Diff line number Diff line change @@ -346,6 +346,7 @@ def build_insert_sql(insert) # :nodoc:
346
346
sql << " ON CONFLICT #{ insert . conflict_target } DO NOTHING"
347
347
elsif insert . update_duplicates?
348
348
sql << " ON CONFLICT #{ insert . conflict_target } DO UPDATE SET "
349
+ sql << insert . touch_model_timestamps_unless { |column | "#{ column } IS excluded.#{ column } " }
349
350
sql << insert . updatable_columns . map { |column | "#{ column } =excluded.#{ column } " } . join ( "," )
350
351
end
351
352
You can’t perform that action at this time.
0 commit comments