האם אפשר לבצע rebake להודעות צ'אט בבת אחת?

I assume that you can (probably similarly to posts), just not sure how. We had an admin run a database edit on all chat messages by mistake trying to edit some in one channel, and now we need to rebake all affected chat messages (Which, unfortunately, seems to be all chat messages in all channels, including DMs)

לייק 1

There is a

rake chat_messages:rebake_uncooked_chat_messages

So I guess you’d need to do something to un-mark them as cooked.

לייק 1

Is there a way we could mark all of them as uncooked? (~99% of our chat messages need rebaked, so just hitting all of them is fine)

2 לייקים
Chat::Message.update_all(cooked_version: nil)

I think that will do it, but I’m not making any promises that it won’t ruin your life.

2 לייקים

Heh, can’t be that much worse than it already is.

Make sure to create a backup first!

לייק 1

Out of curiosity, did that do the trick?

IIRC, I think what we ended up doing was:

  1. Run:
  1. Restore all messages we could from an older backup
  2. Rebake the rest
3 לייקים