summaryrefslogtreecommitdiff
path: root/db/migrate/20220520122755_unlock_delayed_project_removal.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-14 00:08:43 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-14 00:08:43 +0000
commit30da0e79d286cdf137e958ab53ef992f86d8661d (patch)
tree038ebb1da587e33eb52e764c7a1f37119dd791d6 /db/migrate/20220520122755_unlock_delayed_project_removal.rb
parent4ea2496094922fc17d9f7f84c2a44d691c483190 (diff)
downloadgitlab-ce-30da0e79d286cdf137e958ab53ef992f86d8661d.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate/20220520122755_unlock_delayed_project_removal.rb')
-rw-r--r--db/migrate/20220520122755_unlock_delayed_project_removal.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/db/migrate/20220520122755_unlock_delayed_project_removal.rb b/db/migrate/20220520122755_unlock_delayed_project_removal.rb
new file mode 100644
index 00000000000..dc76a95118b
--- /dev/null
+++ b/db/migrate/20220520122755_unlock_delayed_project_removal.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+class UnlockDelayedProjectRemoval < Gitlab::Database::Migration[2.0]
+ disable_ddl_transaction!
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ class ApplicationSetting < MigrationRecord
+ self.table_name = 'application_settings'
+ end
+
+ # As part of https://gitlab.com/gitlab-org/gitlab/-/merge_requests/86568 the
+ # lock_delayed_project_removal setting is updated for the first time. No up
+ # migration is needed because the column existsted. However a down migration
+ # is needed to disable the settting because users would have no way to edit it
+ # and would have the cascading setting permanently locked on groups.
+
+ def up
+ # no-op
+ end
+
+ def down
+ ApplicationSetting.reset_column_information
+
+ ApplicationSetting.update_all(lock_delayed_project_removal: false)
+ end
+end