diff options
Diffstat (limited to 'app/models/internal_id.rb')
-rw-r--r-- | app/models/internal_id.rb | 24 |
1 files changed, 0 insertions, 24 deletions
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 |