Commit 84046205 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch '204839-registry-application-settings' into 'master'

Add container registry settings to app settings

See merge request gitlab-org/gitlab!31125
parents 23fad217 2ff16df0
......@@ -43,7 +43,10 @@ module ApplicationSettingImplementation
authorized_keys_enabled: true, # TODO default to false if the instance is configured to use AuthorizedKeysCommand
commit_email_hostname: default_commit_email_hostname,
container_expiration_policies_enable_historic_entries: false,
container_registry_features: [],
container_registry_token_expire_delay: 5,
container_registry_vendor: '',
container_registry_version: '',
default_artifacts_expire_in: '30 days',
default_branch_protection: Settings.gitlab['default_branch_protection'],
default_ci_config_path: nil,
......
---
title: Add container registry settings to application_settings table
merge_request: 31125
author:
type: added
# frozen_string_literal: true
class AddRegistrySettingsToApplicationSettings < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
# rubocop:disable Migration/AddLimitToTextColumns
def up
add_column_with_default(:application_settings,
:container_registry_vendor,
:text,
default: '',
allow_null: false)
add_column_with_default(:application_settings,
:container_registry_version,
:text,
default: '',
allow_null: false)
end
# rubocop:enable Migration/AddLimitToTextColumns
def down
remove_column :application_settings, :container_registry_vendor
remove_column :application_settings, :container_registry_version
end
end
# frozen_string_literal: true
class AddTextLimitToContainerRegistryVendor < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_text_limit :application_settings, :container_registry_vendor, 255
end
def down
remove_text_limit :application_settings, :container_registry_vendor
end
end
# frozen_string_literal: true
class AddTextLimitToContainerRegistryVersion < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_text_limit :application_settings, :container_registry_version, 255
end
def down
remove_text_limit :application_settings, :container_registry_version
end
end
# frozen_string_literal: true
class AddContainerRegistryFeaturesToApplicationSettings < ActiveRecord::Migration[6.0]
DOWNTIME = false
def up
add_column :application_settings, :container_registry_features, :text, array: true, default: [], null: false # rubocop:disable Migration/AddLimitToTextColumns
end
def down
remove_column :application_settings, :container_registry_features
end
end
......@@ -438,7 +438,12 @@ CREATE TABLE public.application_settings (
container_expiration_policies_enable_historic_entries boolean DEFAULT false NOT NULL,
issues_create_limit integer DEFAULT 300 NOT NULL,
push_rule_id bigint,
group_owners_can_manage_default_branch_protection boolean DEFAULT true NOT NULL
group_owners_can_manage_default_branch_protection boolean DEFAULT true NOT NULL,
container_registry_vendor text DEFAULT ''::text NOT NULL,
container_registry_version text DEFAULT ''::text NOT NULL,
container_registry_features text[] DEFAULT '{}'::text[] NOT NULL,
CONSTRAINT check_d03919528d CHECK ((char_length(container_registry_vendor) <= 255)),
CONSTRAINT check_e5aba18f02 CHECK ((char_length(container_registry_version) <= 255))
);
CREATE SEQUENCE public.application_settings_id_seq
......@@ -13722,6 +13727,10 @@ COPY "schema_migrations" (version) FROM STDIN;
20200429181335
20200429181955
20200429182245
20200505164958
20200505171834
20200505172405
20200506125731
20200507221434
\.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment