diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-20 18:19:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-20 18:19:03 +0300 |
commit | 14bd84b61276ef29b97d23642d698de769bacfd2 (patch) | |
tree | f9eba90140c1bd874211dea17750a0d422c04080 /db/post_migrate/20230309071242_delete_security_policy_bot_users.rb | |
parent | 891c388697b2db0d8ee0c8358a9bdbf6dc56d581 (diff) |
Add latest changes from gitlab-org/gitlab@15-10-stable-eev15.10.0-rc42
Diffstat (limited to 'db/post_migrate/20230309071242_delete_security_policy_bot_users.rb')
-rw-r--r-- | db/post_migrate/20230309071242_delete_security_policy_bot_users.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/db/post_migrate/20230309071242_delete_security_policy_bot_users.rb b/db/post_migrate/20230309071242_delete_security_policy_bot_users.rb new file mode 100644 index 00000000000..0a9ace2574c --- /dev/null +++ b/db/post_migrate/20230309071242_delete_security_policy_bot_users.rb @@ -0,0 +1,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 |