2023-07-12 17:47:08 +10:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-06-29 21:56:55 +10:00
|
|
|
class AddThumbnailColumnsToMediaAttachments < ActiveRecord::Migration[5.2]
|
|
|
|
def up
|
2024-05-21 00:59:27 +10:00
|
|
|
# The following corresponds to `add_attachment :media_attachments, :thumbnail` in an older version of Paperclip
|
|
|
|
add_column :media_attachments, :thumbnail_file_name, :string
|
|
|
|
add_column :media_attachments, :thumbnail_content_type, :string
|
|
|
|
add_column :media_attachments, :thumbnail_file_size, :integer
|
|
|
|
add_column :media_attachments, :thumbnail_updated_at, :datetime
|
|
|
|
|
2020-06-29 21:56:55 +10:00
|
|
|
add_column :media_attachments, :thumbnail_remote_url, :string
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
remove_attachment :media_attachments, :thumbnail
|
|
|
|
remove_column :media_attachments, :thumbnail_remote_url
|
|
|
|
end
|
|
|
|
end
|