Class: Lhm::Cleanup::Current

Inherits:
Object
  • Object
show all
Defined in:
lib/lhm/cleanup/current.rb

Constant Summary collapse

LOG_PREFIX =
"Current"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(run, origin_table_name, connection, options = {}) ⇒ Current

Returns a new instance of Current.



10
11
12
13
14
15
16
# File 'lib/lhm/cleanup/current.rb', line 10

def initialize(run, origin_table_name, connection, options={})
  @run = run
  @table_name = TableName.new(origin_table_name)
  @connection = connection
  @ddls = []
  @retry_config = options[:retriable] || {}
end

Instance Attribute Details

#connectionObject (readonly)

Returns the value of attribute connection.



18
19
20
# File 'lib/lhm/cleanup/current.rb', line 18

def connection
  @connection
end

#ddlsObject (readonly)

Returns the value of attribute ddls.



18
19
20
# File 'lib/lhm/cleanup/current.rb', line 18

def ddls
  @ddls
end

#runObject (readonly)

Returns the value of attribute run.



18
19
20
# File 'lib/lhm/cleanup/current.rb', line 18

def run
  @run
end

Instance Method Details

#executeObject



20
21
22
23
24
25
26
27
28
# File 'lib/lhm/cleanup/current.rb', line 20

def execute
  build_statements_for_drop_lhm_triggers_for_origin
  build_statements_for_rename_lhmn_tables_for_origin
  if run
    execute_ddls
  else
    report_ddls
  end
end