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

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

class DeleteSecurityPolicyBotUsers < Gitlab::Database::Migration[2.1]
  restrict_gitlab_migration gitlab_schema: :gitlab_main

  class User < MigrationRecord
    self.table_name = 'users'

    enum user_type: { security_policy_bot: 10 }
  end

  def up
    User.where(user_type: :security_policy_bot).delete_all
  end

  def down
    # no-op

    # Deleted records can't be restored
  end
end