Commit 8def25d9 authored by Michael Kozono's avatar Michael Kozono

Fix datetime inserts on MySQL

parent aefbdcdc
...@@ -124,10 +124,8 @@ module Gitlab ...@@ -124,10 +124,8 @@ module Gitlab
end end
def table_columns_and_values_for_insert(file_paths) def table_columns_and_values_for_insert(file_paths)
timestamp = Time.now.utc.iso8601
values = file_paths.map do |file_path| values = file_paths.map do |file_path|
ActiveRecord::Base.send(:sanitize_sql_array, ['(?, ?, ?)', file_path, timestamp, timestamp]) # rubocop:disable GitlabSecurity/PublicSend ActiveRecord::Base.send(:sanitize_sql_array, ['(?, NOW(), NOW())', file_path]) # rubocop:disable GitlabSecurity/PublicSend
end.join(', ') end.join(', ')
"#{UntrackedFile.table_name} (path, created_at, updated_at) VALUES #{values}" "#{UntrackedFile.table_name} (path, created_at, updated_at) VALUES #{values}"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment