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

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

class AddSentryClientsideTracesSampleRateConstraint < Gitlab::Database::Migration[2.1]
  disable_ddl_transaction!

  CONSTRAINT_NAME = 'check_app_settings_sentry_clientside_traces_sample_rate_range'

  def up
    add_check_constraint :application_settings,
      'sentry_clientside_traces_sample_rate >= 0 AND sentry_clientside_traces_sample_rate <= 1',
      CONSTRAINT_NAME
  end

  def down
    remove_check_constraint :application_settings, CONSTRAINT_NAME
  end
end