Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
eb50a12a5031
Commit
1d5d57cc
authored
Nov 21, 2017
by
Michael Kozono
Browse files
Fix datetime inserts on MySQL
parent
5707f84f5f38
Changes
1
Show whitespace changes
Inline
Side-by-side
lib/gitlab/background_migration/prepare_untracked_uploads.rb
View file @
eb50a12a
...
...
@@ -124,10 +124,8 @@ def insert_file_paths(file_paths)
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
}
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment