Class: DbDiff::Delta::DropForeignKey

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



205
206
207
# File 'lib/dbdiff/delta.rb', line 205

def process(database)
  table(database).foreign_keys.delete(element) 
end

#sqlObject



201
202
203
# File 'lib/dbdiff/delta.rb', line 201

def sql
  "ALTER table #{element.table_name} DROP FOREIGN KEY `#{element.name}`;\n"
end