2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-31 00:06:56 -04:00
|
|
|
class MoveEmojiToNewLocation < ActiveRecord::Migration[4.2]
|
2013-11-20 00:54:49 -05:00
|
|
|
def up
|
|
|
|
execute(
|
|
|
|
"update posts set cooked = regexp_replace(cooked, '\(<img[^\>]*)assets\/emoji\/', '\\1plugins\/emoji\/images\/' , 'g') where cooked like '%emoji%'",
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
execute(
|
|
|
|
"update posts set cooked = regexp_replace(cooked, '\(<img[^\>]*)plugins\/emoji\/images\/', '\\1assets\/emoji\/' , 'g') where cooked like '%emoji%'",
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|