Class: DbDiff::Delta::AddTrigger

Inherits:
DbDiff::Delta show all
Defined in:
lib/dbdiff/delta.rb

Instance Attribute Summary

Attributes inherited from DbDiff::Delta

#element

Instance Method Summary collapse

Methods inherited from DbDiff::Delta

#initialize, #table, #to_a

Constructor Details

This class inherits a constructor from DbDiff::Delta

Instance Method Details

#process(database) ⇒ Object



336
337
338
# File 'lib/dbdiff/delta.rb', line 336

def process(database)
  table(database).triggers << element
end

#sqlObject



332
333
334
# File 'lib/dbdiff/delta.rb', line 332

def sql
  return "CREATE TRIGGER `#{element.name}` #{element.timing} #{element.event} ON #{element.table_name} FOR EACH ROW #{element.definition}"
end