Skip to content
Snippets Groups Projects
Commit 8def25d9 authored by Michael Kozono's avatar Michael Kozono
Browse files

Fix datetime inserts on MySQL

parent aefbdcdc
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -124,10 +124,8 @@ module Gitlab
end
 
def table_columns_and_values_for_insert(file_paths)
timestamp = Time.now.utc.iso8601
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(', ')
 
"#{UntrackedFile.table_name} (path, created_at, updated_at) VALUES #{values}"
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment