diff options
author | Stan Hu <stanhu@gmail.com> | 2019-08-05 17:33:39 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-08-05 17:33:39 +0000 |
commit | c368bae5b745f7707184ac9d589d7717aa0af258 (patch) | |
tree | 7a2d19cd23a74f24c1583381af1af88e1538b880 /lib | |
parent | 7205687cdc552a9b69ceafca102f3837eefb3116 (diff) | |
parent | afb3c3c1fbfd6252bc00ed030015476013b170dd (diff) | |
download | gitlab-ce-c368bae5b745f7707184ac9d589d7717aa0af258.tar.gz |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/background_migration/migrate_legacy_artifacts.rb | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/gitlab/background_migration/migrate_legacy_artifacts.rb b/lib/gitlab/background_migration/migrate_legacy_artifacts.rb index 5cd638083b0..4377ec2987c 100644 --- a/lib/gitlab/background_migration/migrate_legacy_artifacts.rb +++ b/lib/gitlab/background_migration/migrate_legacy_artifacts.rb @@ -39,10 +39,10 @@ module Gitlab SELECT project_id, id, - artifacts_expire_at, + artifacts_expire_at #{add_missing_db_timezone}, #{LEGACY_PATH_FILE_LOCATION}, - created_at, - created_at, + created_at #{add_missing_db_timezone}, + created_at #{add_missing_db_timezone}, artifacts_file, artifacts_size, COALESCE(artifacts_file_store, #{FILE_LOCAL_STORE}), @@ -81,10 +81,10 @@ module Gitlab SELECT project_id, id, - artifacts_expire_at, + artifacts_expire_at #{add_missing_db_timezone}, #{LEGACY_PATH_FILE_LOCATION}, - created_at, - created_at, + created_at #{add_missing_db_timezone}, + created_at #{add_missing_db_timezone}, artifacts_metadata, NULL, COALESCE(artifacts_metadata_store, #{FILE_LOCAL_STORE}), @@ -121,6 +121,12 @@ module Gitlab AND artifacts_file <> '' SQL end + + def add_missing_db_timezone + return '' unless Gitlab::Database.postgresql? + + 'at time zone \'UTC\'' + end end end end |