Sha256: 01d6554e65b596b1f6cddc58c792ab4cb3b6dfa6cd4e0b8d088493b1bce396ba

Contents?: true

Size: 720 Bytes

Versions: 26

Compression:

Stored size: 720 Bytes

Contents

# This migration comes from active_storage (originally 20190112182829)
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

26 entries across 26 versions & 1 rubygems

Version Path
panda_cms-0.6.3 db/migrate/20240701225422_add_service_name_to_active_storage_blobs.active_storage.rb
panda_cms-0.6.2 db/migrate/20240701225422_add_service_name_to_active_storage_blobs.active_storage.rb
panda_cms-0.6.1 db/migrate/20240701225422_add_service_name_to_active_storage_blobs.active_storage.rb
panda_cms-0.6.0 db/migrate/20240701225422_add_service_name_to_active_storage_blobs.active_storage.rb
panda_cms-0.5.10 db/migrate/20240701225422_add_service_name_to_active_storage_blobs.active_storage.rb
panda_cms-0.5.9 db/migrate/20240701225422_add_service_name_to_active_storage_blobs.active_storage.rb
panda_cms-0.5.8 db/migrate/20240701225422_add_service_name_to_active_storage_blobs.active_storage.rb
panda_cms-0.5.7 db/migrate/20240701225422_add_service_name_to_active_storage_blobs.active_storage.rb
panda_cms-0.5.6 db/migrate/20240701225422_add_service_name_to_active_storage_blobs.active_storage.rb
panda_cms-0.5.5 db/migrate/20240701225422_add_service_name_to_active_storage_blobs.active_storage.rb
panda_cms-0.5.4 db/migrate/20240701225422_add_service_name_to_active_storage_blobs.active_storage.rb
panda_cms-0.5.3 db/migrate/20240701225422_add_service_name_to_active_storage_blobs.active_storage.rb
panda_cms-0.5.2 db/migrate/20240701225422_add_service_name_to_active_storage_blobs.active_storage.rb
panda_cms-0.5.1 db/migrate/20240701225422_add_service_name_to_active_storage_blobs.active_storage.rb
panda_cms-0.5.0 db/migrate/20240701225422_add_service_name_to_active_storage_blobs.active_storage.rb
panda_cms-0.3.15 db/migrate/20240701225422_add_service_name_to_active_storage_blobs.active_storage.rb
panda_cms-0.3.14 db/migrate/20240701225422_add_service_name_to_active_storage_blobs.active_storage.rb
panda_cms-0.3.13 db/migrate/20240701225422_add_service_name_to_active_storage_blobs.active_storage.rb
panda_cms-0.3.12 db/migrate/20240701225422_add_service_name_to_active_storage_blobs.active_storage.rb
panda_cms-0.3.11 db/migrate/20240701225422_add_service_name_to_active_storage_blobs.active_storage.rb