]> git.openstreetmap.org Git - rails.git/blobdiff - db/migrate/20210510083027_add_service_name_to_active_storage_blobs.active_storage.rb
Update to rails 6.1.3.2
[rails.git] / db / migrate / 20210510083027_add_service_name_to_active_storage_blobs.active_storage.rb
diff --git a/db/migrate/20210510083027_add_service_name_to_active_storage_blobs.active_storage.rb b/db/migrate/20210510083027_add_service_name_to_active_storage_blobs.active_storage.rb
new file mode 100644 (file)
index 0000000..97a1ff2
--- /dev/null
@@ -0,0 +1,13 @@
+# This migration comes from active_storage (originally 20190112182829)
+class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0]
+  def up
+    unless column_exists?(:active_storage_blobs, :service_name)
+      add_column :active_storage_blobs, :service_name, :string, :null => false, :default => ActiveStorage::Blob.service.name
+      change_column :active_storage_blobs, :service_name, :string, :null => false, :default => nil
+    end
+  end
+
+  def down
+    remove_column :active_storage_blobs, :service_name
+  end
+end