OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/db/migrate/20211118203332_clean_hide_m...

19 lines
464 B

class CleanHideMail < ActiveRecord::Migration[6.1]
def up
execute <<~SQL.squish
UPDATE user_preferences
SET settings = settings - 'hide_mail' || '{"hide_mail": false}'
WHERE settings ->> 'hide_mail' = '0'
SQL
execute <<~SQL.squish
UPDATE user_preferences
SET settings = settings - 'hide_mail' || '{"hide_mail": true}'
WHERE settings ->> 'hide_mail' = '1'
SQL
end
def down
# Nothing to do
end
end