mirror of
https://github.com/discourse/discourse.git
synced 2024-12-05 04:06:27 +08:00
0924f874bd
We've had the UploadReference table for some time now in core, but it was added after ChatUpload was and chat was just never moved over to this new system. This commit changes all chat code dealing with uploads to create/ update/delete/query UploadReference records instead of ChatUpload records for consistency. At a later date we will drop the ChatUpload table, but for now keeping it for data backup. The migration + post migration are the same, we need both in case any chat uploads are added/removed during deploy.
29 lines
835 B
Ruby
29 lines
835 B
Ruby
# frozen_string_literal: true
|
|
|
|
# TODO (martin) DEPRECATED: Remove this model once UploadReference has been
|
|
# in place for a couple of months, 2023-04-01
|
|
#
|
|
# NOTE: Do not use this model anymore, chat messages are linked to uploads via
|
|
# the UploadReference table now, just like everything else.
|
|
class ChatUpload < ActiveRecord::Base
|
|
belongs_to :chat_message
|
|
belongs_to :upload
|
|
|
|
deprecate *public_instance_methods(false)
|
|
end
|
|
|
|
# == Schema Information
|
|
#
|
|
# Table name: chat_uploads
|
|
#
|
|
# id :bigint not null, primary key
|
|
# chat_message_id :integer not null
|
|
# upload_id :integer not null
|
|
# created_at :datetime not null
|
|
# updated_at :datetime not null
|
|
#
|
|
# Indexes
|
|
#
|
|
# index_chat_uploads_on_chat_message_id_and_upload_id (chat_message_id,upload_id) UNIQUE
|
|
#
|