From 0d9899198f05224505d7aae1ce72a8ce00ea2d09 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 31 Jul 2015 19:06:19 -0400 Subject: [PATCH] Migrate old moved posts messages in English --- db/migrate/20150731225331_migrate_old_moved_posts.rb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 db/migrate/20150731225331_migrate_old_moved_posts.rb diff --git a/db/migrate/20150731225331_migrate_old_moved_posts.rb b/db/migrate/20150731225331_migrate_old_moved_posts.rb new file mode 100644 index 000000000..73add43de --- /dev/null +++ b/db/migrate/20150731225331_migrate_old_moved_posts.rb @@ -0,0 +1,6 @@ +class MigrateOldMovedPosts < ActiveRecord::Migration + def up + execute "UPDATE posts SET post_type = 3, action_code = 'split_topic' WHERE post_type = 2 AND raw ~* '^I moved [a\\d]+ posts? to a new topic:'" + execute "UPDATE posts SET post_type = 3, action_code = 'split_topic' WHERE post_type = 2 AND raw ~* '^I moved [a\\d]+ posts? to an existing topic:'" + end +end