Class: ChangeForeignKeyInModulePlatforms
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- ChangeForeignKeyInModulePlatforms
- Defined in:
- db/migrate/20130412174254_change_foreign_key_in_module_platforms.rb
Overview
Changes module_platforms.module_detail_id to module_platforms.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_platforms
Instance Method Summary collapse
-
#down ⇒ void
Renames
module_platforms.detail_idtomodule_platforms.module_detail_id. -
#up ⇒ void
Rename
module_platforms.module_detail_idtomodule_platforms.detail_id.
Instance Method Details
#down ⇒ void
This method returns an undefined value.
Renames module_platforms.detail_id to module_platforms.module_detail_id.
15 16 17 |
# File 'db/migrate/20130412174254_change_foreign_key_in_module_platforms.rb', line 15 def down rename_column TABLE_NAME, NEW_COLUMN_NAME, OLD_COLUMN_NAME end |
#up ⇒ void
This method returns an undefined value.
Rename module_platforms.module_detail_id to module_platforms.detail_id
22 23 24 |
# File 'db/migrate/20130412174254_change_foreign_key_in_module_platforms.rb', line 22 def up rename_column TABLE_NAME, OLD_COLUMN_NAME, NEW_COLUMN_NAME end |