discourse/plugins/chat/app/models/chat_message_revision.rb
Martin Brennan 766bcbc684
FIX: Add editing user ids to ChatMessage and ChatMessageRevision (#18877)
This commit adds last_editor_id to ChatMessage for parity with Post in
core, as well as adding user_id to the ChatMessageRevision record since
we need to know who is making edits and revisions to messages, in case
in future we want to allow more than just the current user to edit chat
messages. The backfill for data here simply uses the record's creating
user ID, but in future if we allow other people to edit the messages it
will use their ID.
2022-11-07 09:04:47 +10:00

25 lines
641 B
Ruby

# frozen_string_literal: true
class ChatMessageRevision < ActiveRecord::Base
belongs_to :chat_message
belongs_to :user
end
# == Schema Information
#
# Table name: chat_message_revisions
#
# id :bigint not null, primary key
# chat_message_id :integer
# old_message :text not null
# new_message :text not null
# created_at :datetime not null
# updated_at :datetime not null
# user_id :integer
#
# Indexes
#
# index_chat_message_revisions_on_chat_message_id (chat_message_id)
# index_chat_message_revisions_on_user_id (user_id)
#