Class: DbDiff::Delta::AddKey

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



153
154
155
156
# File 'lib/dbdiff/delta.rb', line 153

def process(database)
  table = table(database)
  table.keys << element
end

#sqlObject



149
150
151
# File 'lib/dbdiff/delta.rb', line 149

def sql
  "ALTER table #{element.table_name} ADD" + element.definition
end