Sha256: 882a6b51b3a4d5d047d0c28d2ac95f306e566fc5a3d05facbec75293cfb63a48
Contents?: true
Size: 817 Bytes
Versions: 25
Compression:
Stored size: 817 Bytes
Contents
# frozen_string_literal: true # This migration comes from active_storage (originally 20190112182829) class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0] def up return if column_exists?(:active_storage_blobs, :service_name) add_column :active_storage_blobs, :service_name, :string # rubocop:disable Lint/AssignmentInCondition # rubocop:disable Rails/SkipsModelValidations if configured_service = ActiveStorage::Blob.service.name ActiveStorage::Blob.unscoped.update_all(service_name: configured_service) end # rubocop:enable Lint/AssignmentInCondition # rubocop:enable Rails/SkipsModelValidations change_column :active_storage_blobs, :service_name, :string, null: false end def down remove_column :active_storage_blobs, :service_name end end
Version data entries
25 entries across 25 versions & 1 rubygems