Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[#53945] added migration for storage access management

Eric Schubert617dde436458
diff --git a/modules/storages/db/migrate/20240405135016_update_access_management_of_configured_one_drive_storages.rb b/modules/storages/db/migrate/20240405135016_update_access_management_of_configured_one_drive_storages.rb
new file mode 100644
index 00000000000..c0383303413
--- /dev/null
+++ b/modules/storages/db/migrate/20240405135016_update_access_management_of_configured_one_drive_storages.rb
@@ -0,0 +1,11 @@
+class UpdateAccessManagementOfConfiguredOneDriveStorages < ActiveRecord::Migration[7.1]
+ def up
+ execute <<-SQL.squish
+ UPDATE storages
+ SET provider_fields = jsonb_set(provider_fields, '{automatically_managed}', 'false', true)
+ WHERE provider_type = 'Storages::OneDriveStorage' AND provider_fields->>'automatically_managed' is null;
+ SQL
+ end
+
+ def down; end
+end