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

20221206235208_add_max_terraform_state_size_bytes_to_application_settings.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 28bfce8ac0bfa10dcd3b44b97d3906d1f6d087c6 (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
# frozen_string_literal: true

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

  CONSTRAINT_NAME = "app_settings_max_terraform_state_size_bytes_check"

  def up
    add_column(
      :application_settings,
      :max_terraform_state_size_bytes,
      :integer,
      null: false,
      default: 0,
      if_not_exists: true
    )

    add_check_constraint :application_settings, "max_terraform_state_size_bytes >= 0", CONSTRAINT_NAME
  end

  def down
    remove_column :application_settings, :max_terraform_state_size_bytes, if_exists: true
  end
end