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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20220628120708_create_namespace_bans.rb')
-rw-r--r--db/migrate/20220628120708_create_namespace_bans.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/db/migrate/20220628120708_create_namespace_bans.rb b/db/migrate/20220628120708_create_namespace_bans.rb
new file mode 100644
index 00000000000..657d13f6448
--- /dev/null
+++ b/db/migrate/20220628120708_create_namespace_bans.rb
@@ -0,0 +1,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