summaryrefslogtreecommitdiff
path: root/db/migrate/20210713211008_create_banned_users.rb
blob: 7e5eb7f95b84f5bf0c515da9237ccd1941a139bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

class CreateBannedUsers < ActiveRecord::Migration[6.1]
  include Gitlab::Database::MigrationHelpers

  def up
    with_lock_retries do
      create_table :banned_users, id: false do |t|
        t.timestamps_with_timezone null: false
        t.references :user, primary_key: true, default: nil, foreign_key: { on_delete: :cascade }, type: :bigint, index: false, null: false
      end
    end
  end

  def down
    with_lock_retries do
      drop_table :banned_users
    end
  end
end