mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
I... forgot the migration
This commit is contained in:
parent
4a57426b8e
commit
6938631524
@ -0,0 +1,17 @@
|
||||
class AddServiceNameMigrationAgain < ActiveRecord::Migration[6.1]
|
||||
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
|
||||
Loading…
Reference in New Issue
Block a user