Class: ChangeForeignKeyInModuleRefs

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
db/migrate/20130412174719_change_foreign_key_in_module_refs.rb

Overview

Changes module_refs.module_detail_id to module_refs.detail_id so that foreign key matches the conventional name when Mdm::ModuleDetail became Mdm::Module::Detail.

Constant Summary collapse

NEW_COLUMN_NAME =

CONSTANTS

:detail_id
OLD_COLUMN_NAME =
:module_detail_id
TABLE_NAME =
:module_refs

Instance Method Summary collapse

Instance Method Details

#downvoid

This method returns an undefined value.

Renames module_refs.detail_id to module_refs.module_detail_id.



15
16
17
# File 'db/migrate/20130412174719_change_foreign_key_in_module_refs.rb', line 15

def down
  rename_column TABLE_NAME, NEW_COLUMN_NAME, OLD_COLUMN_NAME
end

#upvoid

This method returns an undefined value.

Rename module_refs.module_detail_id to module_refs.detail_id



22
23
24
# File 'db/migrate/20130412174719_change_foreign_key_in_module_refs.rb', line 22

def up
  rename_column TABLE_NAME, OLD_COLUMN_NAME, NEW_COLUMN_NAME
end