discourse/db/migrate/20190503180839_remove_like_...

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
364 B
Ruby
Raw Normal View History

2019-05-12 21:55:44 -04:00
# frozen_string_literal: true
class RemoveLikeCountFromPostMenu < ActiveRecord::Migration[5.2]
def up
execute(<<~SQL)
UPDATE site_settings
SET value = REGEXP_REPLACE(REPLACE(REPLACE(value, 'like-count', ''), '||', '|'), '^\\|', '')
WHERE name = 'post_menu'
SQL
end
def down
raise ActiveRecord::IrreversibleMigration
end
end