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

20200313101649_fill_ghost_user_type.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fa0c02e54139cc2475c3bdea3a086270736524dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: true

class FillGhostUserType < ActiveRecord::Migration[6.0]
  DOWNTIME = false

  def up
    execute('UPDATE users SET user_type = 5 WHERE ghost IS TRUE AND user_type IS NULL')
  end

  def down
    execute('UPDATE users SET user_type = NULL WHERE ghost IS TRUE AND user_type IS NOT NULL')
  end
end