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

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

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

  DOWNTIME = false

  def up
    with_lock_retries do
      create_table :namespace_limits, id: false do |t|
        t.bigint :additional_purchased_storage_size, default: 0, null: false
        t.date :additional_purchased_storage_ends_on, null: true

        t.references :namespace, primary_key: true, default: nil, type: :integer, index: false, foreign_key: { on_delete: :cascade }
      end
    end
  end

  def down
    drop_table :namespace_limits
  end
end