diff --git a/lib/gitlab/cycle_analytics/events_fetcher.rb b/lib/gitlab/cycle_analytics/events_fetcher.rb index bddaede53b7..742ee2f4fb6 100644 --- a/lib/gitlab/cycle_analytics/events_fetcher.rb +++ b/lib/gitlab/cycle_analytics/events_fetcher.rb @@ -111,6 +111,8 @@ module Gitlab end def extract_epoch(arel_attribute) + return arel_attribute unless Gitlab::Database.postgresql? + Arel.sql(%Q{EXTRACT(EPOCH FROM (#{arel_attribute.to_sql}))}) end