20200627125810_add_thumbnail_columns_to_media_attachments.rb 706 B

123456789101112131415161718
  1. # frozen_string_literal: true
  2. class AddThumbnailColumnsToMediaAttachments < ActiveRecord::Migration[5.2]
  3. def up
  4. # The following corresponds to `add_attachment :media_attachments, :thumbnail` in an older version of Paperclip
  5. add_column :media_attachments, :thumbnail_file_name, :string
  6. add_column :media_attachments, :thumbnail_content_type, :string
  7. add_column :media_attachments, :thumbnail_file_size, :integer
  8. add_column :media_attachments, :thumbnail_updated_at, :datetime
  9. add_column :media_attachments, :thumbnail_remote_url, :string
  10. end
  11. def down
  12. remove_attachment :media_attachments, :thumbnail
  13. remove_column :media_attachments, :thumbnail_remote_url
  14. end
  15. end