diff --git a/db/migrate/20131120055018_move_emoji_to_new_location.rb b/db/migrate/20131120055018_move_emoji_to_new_location.rb new file mode 100644 index 00000000000..b5533690728 --- /dev/null +++ b/db/migrate/20131120055018_move_emoji_to_new_location.rb @@ -0,0 +1,9 @@ +class MoveEmojiToNewLocation < ActiveRecord::Migration + def up + execute("update posts set cooked = regexp_replace(cooked, '\(]*)assets\/emoji\/', '\\1plugins\/emoji\/images\/' , 'g') where cooked like '%emoji%'") + end + + def down + execute("update posts set cooked = regexp_replace(cooked, '\(]*)plugins\/emoji\/images\/', '\\1assets\/emoji\/' , 'g') where cooked like '%emoji%'") + end +end