Commit c368bae5 authored by Stan Hu's avatar Stan Hu

Merge branch 'add-missing-timezone-legacy-artifacts' into 'master'

Add missing timezone when copying legacy artifacts (ci_builds)

See merge request gitlab-org/gitlab-ce!31447
parents 7205687c afb3c3c1
...@@ -39,10 +39,10 @@ module Gitlab ...@@ -39,10 +39,10 @@ module Gitlab
SELECT SELECT
project_id, project_id,
id, id,
artifacts_expire_at, artifacts_expire_at #{add_missing_db_timezone},
#{LEGACY_PATH_FILE_LOCATION}, #{LEGACY_PATH_FILE_LOCATION},
created_at, created_at #{add_missing_db_timezone},
created_at, created_at #{add_missing_db_timezone},
artifacts_file, artifacts_file,
artifacts_size, artifacts_size,
COALESCE(artifacts_file_store, #{FILE_LOCAL_STORE}), COALESCE(artifacts_file_store, #{FILE_LOCAL_STORE}),
...@@ -81,10 +81,10 @@ module Gitlab ...@@ -81,10 +81,10 @@ module Gitlab
SELECT SELECT
project_id, project_id,
id, id,
artifacts_expire_at, artifacts_expire_at #{add_missing_db_timezone},
#{LEGACY_PATH_FILE_LOCATION}, #{LEGACY_PATH_FILE_LOCATION},
created_at, created_at #{add_missing_db_timezone},
created_at, created_at #{add_missing_db_timezone},
artifacts_metadata, artifacts_metadata,
NULL, NULL,
COALESCE(artifacts_metadata_store, #{FILE_LOCAL_STORE}), COALESCE(artifacts_metadata_store, #{FILE_LOCAL_STORE}),
...@@ -121,6 +121,12 @@ module Gitlab ...@@ -121,6 +121,12 @@ module Gitlab
AND artifacts_file <> '' AND artifacts_file <> ''
SQL SQL
end end
def add_missing_db_timezone
return '' unless Gitlab::Database.postgresql?
'at time zone \'UTC\''
end
end end
end end
end end
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