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

20210823213417_create_dependency_proxy_image_ttl_group_policies.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3bbd9c1259efa42dde818b1ad91a45d73fe62046 (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 CreateDependencyProxyImageTtlGroupPolicies < ActiveRecord::Migration[6.1]
  include Gitlab::Database::MigrationHelpers

  def up
    with_lock_retries do
      create_table :dependency_proxy_image_ttl_group_policies, id: false do |t|
        t.timestamps_with_timezone null: false
        t.references :group, primary_key: true, default: nil, index: false, foreign_key: { to_table: :namespaces, on_delete: :cascade }
        t.integer :ttl, default: 90
        t.boolean :enabled, null: false, default: false
      end
    end
  end

  def down
    with_lock_retries do
      drop_table :dependency_proxy_image_ttl_group_policies
    end
  end
end