FIX: Make chat editor IDs not null (#18903)

Follow up to 766bcbc6840c9d665055441bcd77616b3a96e10e

Makes ChatMessage.last_editor_id and ChatMessageRevision.user_id
NOT NULL since they are always filled in now and the last commit
had a migration to backfill this data.
This commit is contained in:
Martin Brennan
2022-11-08 09:06:13 +10:00
committed by GitHub
parent c66743ee3d
commit 4116094e54
7 changed files with 18 additions and 5 deletions

View File

@ -93,9 +93,12 @@ class Chat::MessageMover
destination_channel_id: destination_channel.id,
}
moved_message_ids = DB.query_single(<<~SQL, query_args)
INSERT INTO chat_messages(chat_channel_id, user_id, message, cooked, cooked_version, created_at, updated_at)
INSERT INTO chat_messages(
chat_channel_id, user_id, last_editor_id, message, cooked, cooked_version, created_at, updated_at
)
SELECT :destination_channel_id,
user_id,
last_editor_id,
message,
cooked,
cooked_version,