mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
actually, lets just tackle it this way
This commit is contained in:
parent
10c3d1b60a
commit
7ea89ecac6
@ -1,19 +1,13 @@
|
||||
class RemoveServiceNameFromActiveStorageBlobs < ActiveRecord::Migration[6.0]
|
||||
def up
|
||||
if column_exists?(:active_storage_blobs, :service_name)
|
||||
remove_column :active_storage_blobs, :service_name
|
||||
change_column_default :active_storage_blobs, :service_name, "amazon"
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
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
|
||||
if column_exists?(:active_storage_blobs, :service_name)
|
||||
change_column_default :active_storage_blobs, :service_name, nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user