1# frozen_string_literal: true 2 3module Gitlab 4 module Database 5 module Migrations 6 module Observers 7 class MigrationObserver 8 attr_reader :connection, :observation, :output_dir 9 10 def initialize(observation, output_dir, connection) 11 @connection = connection 12 @observation = observation 13 @output_dir = output_dir 14 end 15 16 def before 17 # implement in subclass 18 end 19 20 def after 21 # implement in subclass 22 end 23 24 def record 25 raise NotImplementedError, 'implement in subclass' 26 end 27 end 28 end 29 end 30 end 31end 32