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