diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-12-15 11:02:24 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-12-15 11:02:24 +0000 |
commit | 77665b52523d13532c16c97090b83c7ef88e2b62 (patch) | |
tree | 1cdc7cc7be982e543bda47d47efaeb8c60966e6f /db/migrate | |
parent | 13756eb3a830e04493ebc048ae72e9271df4411c (diff) | |
download | redmine-77665b52523d13532c16c97090b83c7ef88e2b62.tar.gz redmine-77665b52523d13532c16c97090b83c7ef88e2b62.zip |
Store relation type instead of i18n key in journals (#15704).
git-svn-id: http://svn.redmine.org/redmine/trunk@12416 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20131215104612_store_relation_type_in_journal_details.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/db/migrate/20131215104612_store_relation_type_in_journal_details.rb b/db/migrate/20131215104612_store_relation_type_in_journal_details.rb new file mode 100644 index 000000000..3fa6b1f11 --- /dev/null +++ b/db/migrate/20131215104612_store_relation_type_in_journal_details.rb @@ -0,0 +1,26 @@ +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 |