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 00000000000..73add43deda --- /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