ALTER TABLE chat_messages ADD reply_to_message_id BIGINT REFERENCES chat_messages(id);
CREATE INDEX chat_messages_reply_to_message_id_ix ON chat_messages(reply_to_message_id);

ALTER TABLE ticket_messages ADD reply_to_message_id BIGINT REFERENCES ticket_messages(id);
CREATE INDEX ticket_messages_reply_to_message_id_ix ON ticket_messages(reply_to_message_id);
