summaryrefslogtreecommitdiff
path: root/lib/gitlab/config_checker/external_database_checker.rb
blob: 795082a10a01329c3538a7e1305083734506622b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true

module Gitlab
  module ConfigChecker
    module ExternalDatabaseChecker
      extend self

      # DB is considered deprecated if it is below version 11
      def db_version_deprecated?
        Gitlab::Database.version.to_f < 11
      end

      def check
        return [] unless db_version_deprecated?

        [
          {
            type: 'warning',
            message: _('Note that PostgreSQL 11 will become the minimum required PostgreSQL version in GitLab 13.0 (May 2020). '\
                     'PostgreSQL 9.6 and PostgreSQL 10 will no longer be supported in GitLab 13.0. '\
                     'Please consider upgrading your PostgreSQL version (%{db_version}) soon.') % { db_version: Gitlab::Database.version.to_s }
          }
        ]
      end
    end
  end
end