Mercurial > hg > soundsoftware-site
comparison db/migrate/.svn/text-base/20100129193813_update_mail_notification_values.rb.svn-base @ 119:8661b858af72
* Update to Redmine trunk rev 4705
author | Chris Cannam |
---|---|
date | Thu, 13 Jan 2011 14:12:06 +0000 |
parents | 94944d00e43c |
children |
comparison
equal
deleted
inserted
replaced
39:150ceac17a8d | 119:8661b858af72 |
---|---|
1 # Patch the data from a boolean change. | 1 # Patch the data from a boolean change. |
2 class UpdateMailNotificationValues < ActiveRecord::Migration | 2 class UpdateMailNotificationValues < ActiveRecord::Migration |
3 def self.up | 3 def self.up |
4 User.update_all("mail_notification = 'all'", "mail_notification IN ('1', 't')") | 4 # No-op |
5 User.update_all("mail_notification = 'selected'", "EXISTS (SELECT 1 FROM #{Member.table_name} WHERE #{Member.table_name}.mail_notification = #{connection.quoted_true} AND #{Member.table_name}.user_id = #{User.table_name}.id)") | 5 # See 20100129193402_change_users_mail_notification_to_string.rb |
6 User.update_all("mail_notification = 'only_my_events'", "mail_notification NOT IN ('all', 'selected')") | |
7 end | 6 end |
8 | 7 |
9 def self.down | 8 def self.down |
10 # No-op | 9 # No-op |
11 end | 10 end |