Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20220520122755_unlock_delayed_project_removal.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: aaecf601e2ba3750cb966d1deb9d41c2000dfb31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

class UnlockDelayedProjectRemoval < Gitlab::Database::Migration[2.0]
  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