mirror of
https://github.com/redmine/redmine.git
synced 2024-08-18 14:10:15 +02:00
![Jean-Philippe Lang](/assets/img/avatar_default.png)
git-svn-id: http://svn.redmine.org/redmine/trunk@12416 e93f8b46-1217-0410-a6f0-8f06a7374b81
27 lines
859 B
Ruby
27 lines
859 B
Ruby
class StoreRelationTypeInJournalDetails < ActiveRecord::Migration
|
|
|
|
MAPPING = {
|
|
"label_relates_to" => "relates",
|
|
"label_duplicates" => "duplicates",
|
|
"label_duplicated_by" => "duplicated",
|
|
"label_blocks" => "blocks",
|
|
"label_blocked_by" => "blocked",
|
|
"label_precedes" => "precedes",
|
|
"label_follows" => "follows",
|
|
"label_copied_to" => "copied_to",
|
|
"label_copied_from" => "copied_from"
|
|
}
|
|
|
|
def up
|
|
StoreRelationTypeInJournalDetails::MAPPING.each do |prop_key, replacement|
|
|
JournalDetail.where(:property => 'relation', :prop_key => prop_key).update_all(:prop_key => replacement)
|
|
end
|
|
end
|
|
|
|
def down
|
|
StoreRelationTypeInJournalDetails::MAPPING.each do |prop_key, replacement|
|
|
JournalDetail.where(:property => 'relation', :prop_key => replacement).update_all(:prop_key => prop_key)
|
|
end
|
|
end
|
|
end
|