Thanks for the response. I am nervous to re-run the import script since it’s been almost 6 months and I’m not sure what kind of side-effects it could have in edge cases where old data interacts with new data.
Here’s the helper function I used in my import script.
Here’s the relevant code
created_by = User.find_by(id: user_id_from_imported_user_id(params[:user_id]))
post = Post.find_by(id: post_id_from_imported_post_id(params[:post_id]))
if created_by && post
PostActionCreator.create(created_by, post, :like, created_at: params[:created_at])
created += 1
Yippee! You never know when providing an answer as vague as “Well, what I would do. . .” whether it’ll be of any use.
If you’re going to paste stuff into the rails console, a handy trick to know is that if you terminate your lines with a ; you won’t get pushed into a less pager to see the results of the last statement. (If you write a proper loop, or run a script you don’t need this tip.)