Module: Foreigner::Migration::CommandRecorder
- Defined in:
- lib/foreigner/migration/command_recorder.rb
Instance Method Summary collapse
- #add_foreign_key(*args) ⇒ Object
- #invert_add_foreign_key(args) ⇒ Object
- #remove_foreign_key(*args) ⇒ Object
Instance Method Details
#add_foreign_key(*args) ⇒ Object
4 5 6 |
# File 'lib/foreigner/migration/command_recorder.rb', line 4 def add_foreign_key(*args) record(:add_foreign_key, args) end |
#invert_add_foreign_key(args) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/foreigner/migration/command_recorder.rb', line 12 def invert_add_foreign_key(args) from_table, to_table, = *args ||= {} if [:name] = {:name => [:name]} elsif [:column] = {:column => [:column]} else = to_table end [:remove_foreign_key, [from_table, ]] end |
#remove_foreign_key(*args) ⇒ Object
8 9 10 |
# File 'lib/foreigner/migration/command_recorder.rb', line 8 def remove_foreign_key(*args) record(:remove_foreign_key, args) end |