Class: SO2DB::AddForeignKeyMigration

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/so2db/migrations.rb

Instance Method Summary collapse

Constructor Details

#initialize(from_table, to_table, options) ⇒ AddForeignKeyMigration

Returns a new instance of AddForeignKeyMigration.



48
49
50
51
52
# File 'lib/so2db/migrations.rb', line 48

def initialize(from_table, to_table, options)
  @from_table = from_table
  @to_table = to_table
  @options = options
end

Instance Method Details

#upObject



54
55
56
# File 'lib/so2db/migrations.rb', line 54

def up
  add_foreign_key(@from_table, @to_table, @options)
end