Welcome to mirror list, hosted at ThFree Co, Russian Federation.

migration_observer.rb « observers « migrations « database « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 85d18abb9efa0d2d4ac3da28e78267c5e718f352 (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
28
29
30
# frozen_string_literal: true

module Gitlab
  module Database
    module Migrations
      module Observers
        class MigrationObserver
          attr_reader :connection, :observation

          def initialize(observation)
            @connection = ActiveRecord::Base.connection
            @observation = observation
          end

          def before
            # implement in subclass
          end

          def after
            # implement in subclass
          end

          def record
            raise NotImplementedError, 'implement in subclass'
          end
        end
      end
    end
  end
end