From 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 18 Jun 2020 11:18:50 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-1-stable-ee --- app/models/internal_id.rb | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'app/models/internal_id.rb') diff --git a/app/models/internal_id.rb b/app/models/internal_id.rb index b6882701e23..21cf6bfa414 100644 --- a/app/models/internal_id.rb +++ b/app/models/internal_id.rb @@ -25,8 +25,6 @@ class InternalId < ApplicationRecord validates :usage, presence: true - REQUIRED_SCHEMA_VERSION = 20180305095250 - # Increments #last_value and saves the record # # The operation locks the record and gathers a `ROW SHARE` lock (in PostgreSQL). @@ -63,24 +61,16 @@ class InternalId < ApplicationRecord class << self def track_greatest(subject, scope, usage, new_value, init) - return new_value unless available? - InternalIdGenerator.new(subject, scope, usage) .track_greatest(init, new_value) end def generate_next(subject, scope, usage, init) - # Shortcut if `internal_ids` table is not available (yet) - # This can be the case in other (unrelated) migration specs - return (init.call(subject) || 0) + 1 unless available? - InternalIdGenerator.new(subject, scope, usage) .generate(init) end def reset(subject, scope, usage, value) - return false unless available? - InternalIdGenerator.new(subject, scope, usage) .reset(value) end @@ -95,20 +85,6 @@ class InternalId < ApplicationRecord where(filter).delete_all end - - def available? - return true unless Rails.env.test? - - Gitlab::SafeRequestStore.fetch(:internal_ids_available_flag) do - ActiveRecord::Migrator.current_version >= REQUIRED_SCHEMA_VERSION - end - end - - # Flushes cached information about schema - def reset_column_information - Gitlab::SafeRequestStore[:internal_ids_available_flag] = nil - super - end end class InternalIdGenerator -- cgit v1.2.3