]> source.dussan.org Git - redmine.git/commitdiff
Merged r14052 (#19233).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 8 Mar 2015 09:45:29 +0000 (09:45 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 8 Mar 2015 09:45:29 +0000 (09:45 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/3.0-stable@14063 e93f8b46-1217-0410-a6f0-8f06a7374b81

db/migrate/20150113213922_remove_users_mail.rb

index 8a8b484294ff2b72825afd092ecab307b07c9753..81bbcf1b7dec64b4ccf014e06feac348da1b88ee 100644 (file)
@@ -4,6 +4,10 @@ class RemoveUsersMail < ActiveRecord::Migration
   end
 
   def self.down
-    raise IrreversibleMigration
+    add_column :users, :mail, :string, :limit => 60, :default => '', :null => false
+
+    EmailAddress.where(:is_default => true).each do |a|
+      User.where(:id => a.user_id).update_all(:mail => a.address)
+    end
   end
 end