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/20200928131934_create_required_code_owners_sections.rb')
-rw-r--r--db/migrate/20200928131934_create_required_code_owners_sections.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/db/migrate/20200928131934_create_required_code_owners_sections.rb b/db/migrate/20200928131934_create_required_code_owners_sections.rb
new file mode 100644
index 00000000000..f2dfd4007e5
--- /dev/null
+++ b/db/migrate/20200928131934_create_required_code_owners_sections.rb
@@ -0,0 +1,26 @@
+# frozen_string_literal: true
+
+class CreateRequiredCodeOwnersSections < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ create_table :required_code_owners_sections, if_not_exists: true do |t|
+ t.references :protected_branch, null: false, foreign_key: { on_delete: :cascade }
+ t.text :name, null: false
+ end
+ end
+
+ add_text_limit :required_code_owners_sections, :name, 1024
+ end
+
+ def down
+ with_lock_retries do
+ drop_table :required_code_owners_sections, if_exists: true
+ end
+ end
+end