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

20201215205404_create_namespace_package_settings.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d74b99597ce191c259789c6d78be2971734a2858 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

class CreateNamespacePackageSettings < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    with_lock_retries do
      create_table :namespace_package_settings, if_not_exists: true, id: false do |t|
        t.references :namespace, primary_key: true, index: false, default: nil, foreign_key: { to_table: :namespaces, on_delete: :cascade }, type: :bigint
        t.boolean :maven_duplicates_allowed, null: false, default: true
        t.text :maven_duplicate_exception_regex, null: false, default: ''
      end
    end

    add_text_limit :namespace_package_settings, :maven_duplicate_exception_regex, 255
  end

  def down
    drop_table :namespace_package_settings
  end
end