Sha256: 7d7c81f7a0047f0aaf0f815633535509aba13604bdf2597a290bbc786abf656b

Contents?: true

Size: 718 Bytes

Versions: 16

Compression:

Stored size: 718 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

16 entries across 16 versions & 2 rubygems

Version Path
tessa-6.1.3 spec/dummy/db/migrate/20230406194400_add_service_name_to_active_storage_blobs.active_storage.rb
tessa-6.1.2 spec/dummy/db/migrate/20230406194400_add_service_name_to_active_storage_blobs.active_storage.rb
administrate-field-active_storage-1.0.2 test_app/db/migrate/20231117220800_add_service_name_to_active_storage_blobs.active_storage.rb
tessa-6.1.1 spec/dummy/db/migrate/20230406194400_add_service_name_to_active_storage_blobs.active_storage.rb
tessa-6.1.0 spec/dummy/db/migrate/20230406194400_add_service_name_to_active_storage_blobs.active_storage.rb
administrate-field-active_storage-1.0.1 test_app/db/migrate/20231117220800_add_service_name_to_active_storage_blobs.active_storage.rb
tessa-6.0.3 spec/dummy/db/migrate/20230406194400_add_service_name_to_active_storage_blobs.active_storage.rb
administrate-field-active_storage-1.0.0 test_app/db/migrate/20231117220800_add_service_name_to_active_storage_blobs.active_storage.rb
tessa-6.0.2 spec/dummy/db/migrate/20230406194400_add_service_name_to_active_storage_blobs.active_storage.rb
tessa-6.0.1 spec/dummy/db/migrate/20230406194400_add_service_name_to_active_storage_blobs.active_storage.rb
tessa-6.0.0 spec/dummy/db/migrate/20230406194400_add_service_name_to_active_storage_blobs.active_storage.rb
tessa-6.0.0.rc5 spec/dummy/db/migrate/20230406194400_add_service_name_to_active_storage_blobs.active_storage.rb
tessa-6.0.0.rc4 spec/dummy/db/migrate/20230406194400_add_service_name_to_active_storage_blobs.active_storage.rb
tessa-6.0.0.rc3 spec/dummy/db/migrate/20230406194400_add_service_name_to_active_storage_blobs.active_storage.rb
tessa-6.0.0.rc2 spec/dummy/db/migrate/20230406194400_add_service_name_to_active_storage_blobs.active_storage.rb
tessa-6.0.0.rc1 spec/dummy/db/migrate/20230406194400_add_service_name_to_active_storage_blobs.active_storage.rb