Sha256: 86fc16f52573618a9f48a3d131ec3fc30edf5b839a0b58e5e77c5f264d08e653
Contents?: true
Size: 647 Bytes
Versions: 74
Compression:
Stored size: 647 Bytes
Contents
class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0] def up return unless table_exists?(:active_storage_blobs) unless column_exists?(:active_storage_blobs, :service_name) add_column :active_storage_blobs, :service_name, :string if configured_service = ActiveStorage::Blob.service.name ActiveStorage::Blob.unscoped.update_all(service_name: configured_service) end change_column :active_storage_blobs, :service_name, :string, null: false end end def down return unless table_exists?(:active_storage_blobs) remove_column :active_storage_blobs, :service_name end end
Version data entries
74 entries across 73 versions & 7 rubygems