From 1dcf1d2c840c22e6a52563d3d5e046214595d38c Mon Sep 17 00:00:00 2001 From: Shugo Maeda Date: Mon, 17 Nov 2025 11:56:01 +0900 Subject: [PATCH] Separate remote thumbnails into cache/ directory (#36910) --- app/models/media_attachment.rb | 47 ++++++++++--------- ...14_add_thumbnail_storage_schema_version.rb | 7 +++ 2 files changed, 31 insertions(+), 23 deletions(-) create mode 100644 db/migrate/20251117023614_add_thumbnail_storage_schema_version.rb diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb index 13ca0d7e3ab..2615eed4e39 100644 --- a/app/models/media_attachment.rb +++ b/app/models/media_attachment.rb @@ -4,29 +4,30 @@ # # Table name: media_attachments # -# id :bigint(8) not null, primary key -# status_id :bigint(8) -# file_file_name :string -# file_content_type :string -# file_file_size :integer -# file_updated_at :datetime -# remote_url :string default(""), not null -# created_at :datetime not null -# updated_at :datetime not null -# shortcode :string -# type :integer default("image"), not null -# file_meta :json -# account_id :bigint(8) -# description :text -# scheduled_status_id :bigint(8) -# blurhash :string -# processing :integer -# file_storage_schema_version :integer -# thumbnail_file_name :string -# thumbnail_content_type :string -# thumbnail_file_size :integer -# thumbnail_updated_at :datetime -# thumbnail_remote_url :string +# id :bigint(8) not null, primary key +# blurhash :string +# description :text +# file_content_type :string +# file_file_name :string +# file_file_size :integer +# file_meta :json +# file_storage_schema_version :integer +# file_updated_at :datetime +# processing :integer +# remote_url :string default(""), not null +# shortcode :string +# thumbnail_content_type :string +# thumbnail_file_name :string +# thumbnail_file_size :integer +# thumbnail_remote_url :string +# thumbnail_storage_schema_version :integer +# thumbnail_updated_at :datetime +# type :integer default("image"), not null +# created_at :datetime not null +# updated_at :datetime not null +# account_id :bigint(8) +# scheduled_status_id :bigint(8) +# status_id :bigint(8) # class MediaAttachment < ApplicationRecord diff --git a/db/migrate/20251117023614_add_thumbnail_storage_schema_version.rb b/db/migrate/20251117023614_add_thumbnail_storage_schema_version.rb new file mode 100644 index 00000000000..0a8119642d4 --- /dev/null +++ b/db/migrate/20251117023614_add_thumbnail_storage_schema_version.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddThumbnailStorageSchemaVersion < ActiveRecord::Migration[8.0] + def change + add_column :media_attachments, :thumbnail_storage_schema_version, :integer + end +end