Change comma-delim site settings to pipe-delim

This commit is contained in:
riking
2014-03-29 16:50:44 -07:00
parent b328fd0031
commit 9c4dd1cb35
9 changed files with 41 additions and 10 deletions

View File

@ -0,0 +1,31 @@
class SiteSettingCommaToPipe < ActiveRecord::Migration
def up
execute <<SQL
UPDATE site_settings
SET value = replace(value, ',', '|')
WHERE name = 'white_listed_spam_host_domains'
;
SQL
execute <<SQL
UPDATE site_settings
SET value = replace(value, ',', '|')
WHERE name = 'exclude_rel_nofollow_domains'
;
SQL
end
def down
execute <<SQL
UPDATE site_settings
SET value = replace(value, '|', ',')
WHERE name = 'white_listed_spam_host_domains'
;
SQL
execute <<SQL
UPDATE site_settings
SET value = replace(value, '|', ',')
WHERE name = 'exclude_rel_nofollow_domains'
;
SQL
end
end