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

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

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

  DOWNTIME = false

  disable_ddl_transaction!

  CONSTRAINT_NAME = 'ci_platform_metrics_check_count_positive'

  def up
    add_check_constraint :ci_platform_metrics, 'count > 0', CONSTRAINT_NAME
  end

  def down
    remove_check_constraint :ci_platform_metrics, CONSTRAINT_NAME
  end
end