Class: DbDiff::Delta::DropColumn

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



25
26
27
28
# File 'lib/dbdiff/delta.rb', line 25

def process(database)
  table = table(database)
  table.columns.delete(element)
end

#sqlObject



21
22
23
# File 'lib/dbdiff/delta.rb', line 21

def sql
  "ALTER TABLE #{element.table_name} DROP COLUMN `#{element.name}`"
end