Sha256: 98b6ad10b79796fe1a5a9ae67c721a1278712a54242e36f4f90ebf0965549e15
Contents?: true
Size: 535 Bytes
Versions: 40
Compression:
Stored size: 535 Bytes
Contents
class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0] def up 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 remove_column :active_storage_blobs, :service_name end end
Version data entries
40 entries across 38 versions & 4 rubygems