mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
This will make future changes to the 'pull hotlinked images' system easier. This commit should not introduce any functional change. For now, the old post_custom_field data is kept in the database. This will be dropped in a future commit.
30 lines
721 B
Ruby
30 lines
721 B
Ruby
# frozen_string_literal: true
|
|
|
|
class PostHotlinkedMedia < ActiveRecord::Base
|
|
belongs_to :post
|
|
belongs_to :upload
|
|
enum status: {
|
|
downloaded: "downloaded",
|
|
too_large: "too_large",
|
|
download_failed: "download_failed",
|
|
upload_create_failed: "upload_create_failed"
|
|
}
|
|
end
|
|
|
|
# == Schema Information
|
|
#
|
|
# Table name: post_hotlinked_media
|
|
#
|
|
# id :bigint not null, primary key
|
|
# post_id :bigint not null
|
|
# url :string not null
|
|
# status :enum not null
|
|
# upload_id :bigint
|
|
# created_at :datetime not null
|
|
# updated_at :datetime not null
|
|
#
|
|
# Indexes
|
|
#
|
|
# index_post_hotlinked_media_on_post_id_and_url (post_id,url) UNIQUE
|
|
#
|