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

20230725085120_update_remote_development_agent_configs_for_firewall_rules.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 184fdb0ec9f11a775e1da445be4cd433472489c6 (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 UpdateRemoteDevelopmentAgentConfigsForFirewallRules < Gitlab::Database::Migration[2.1]
  disable_ddl_transaction!

  def up
    with_lock_retries do
      add_column :remote_development_agent_configs, :network_policy_enabled, :boolean, default: true, null: false
      add_column :remote_development_agent_configs, :gitlab_workspaces_proxy_namespace, :text,
        default: "gitlab-workspaces", null: false
    end
    # Kubernetes namespaces are limited to 63 characters
    add_text_limit :remote_development_agent_configs, :gitlab_workspaces_proxy_namespace, 63
  end

  def down
    with_lock_retries do
      remove_column :remote_development_agent_configs, :gitlab_workspaces_proxy_namespace, if_exists: true
      remove_column :remote_development_agent_configs, :network_policy_enabled, if_exists: true
    end
  end
end