diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-23 18:10:34 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-23 18:10:34 +0300 |
commit | a8b96c3072b3bd4d45e6364931042b350bf7fa2e (patch) | |
tree | 70d8a5faa2171c82a0007364f89c11d2e45aeac5 /lib/gitlab/database.rb | |
parent | 8137303e47baaff97a36396cfb05efc0d99879a2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/database.rb')
-rw-r--r-- | lib/gitlab/database.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/gitlab/database.rb b/lib/gitlab/database.rb index e750edc393f..b9173c96928 100644 --- a/lib/gitlab/database.rb +++ b/lib/gitlab/database.rb @@ -34,10 +34,8 @@ module Gitlab # https://gitlab.com/gitlab-org/gitlab-foss/issues/61974 MAX_TEXT_SIZE_LIMIT = 1_000_000 - # Minimum schema version from which migrations are supported # Migrations before this version may have been removed - MIN_SCHEMA_VERSION = 20190506135400 - MIN_SCHEMA_GITLAB_VERSION = '11.11.0' + MIN_SCHEMA_GITLAB_VERSION = '15.0' # Schema we store dynamically managed partitions in (e.g. for time partitioning) DYNAMIC_PARTITIONS_SCHEMA = :gitlab_partitions_dynamic @@ -304,6 +302,14 @@ module Gitlab !read_only? end + # Determines minimum viable migration version, determined by the timestamp + # of the earliest migration file. + def self.read_minimum_migration_version + Dir.open( + Rails.root.join('db/migrate') + ).filter_map { |f| /\A\d{14}/.match(f)&.to_s }.map(&:to_i).min + end + # Monkeypatch rails with upgraded database observability def self.install_transaction_metrics_patches! ActiveRecord::Base.prepend(ActiveRecordBaseTransactionMetrics) |