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

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

class CreateNamespaceBans < Gitlab::Database::Migration[2.0]
  UNIQUE_INDEX_NAME = 'index_namespace_bans_on_namespace_id_and_user_id'

  def change
    create_table :namespace_bans do |t|
      t.bigint :namespace_id, null: false
      t.bigint :user_id, null: false, index: true
      t.timestamps_with_timezone

      t.index [:namespace_id, :user_id], unique: true, name: UNIQUE_INDEX_NAME
    end
  end
end