ALTER TABLE team_messages
  ADD COLUMN review_source_file_id CHAR(36) NULL AFTER attachment_file_id,
  ADD KEY idx_team_messages_review_source_file (review_source_file_id),
  ADD CONSTRAINT fk_team_messages_review_source_file
    FOREIGN KEY (review_source_file_id) REFERENCES files (id)
    ON DELETE SET NULL;

ALTER TABLE team_message_attachment_comments
  ADD COLUMN updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
    ON UPDATE CURRENT_TIMESTAMP AFTER created_at;
