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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-12-04 15:12:44 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-12-04 15:12:44 +0300
commit157061839634d24bdb937316373f35bf1fb1f71e (patch)
treecfdf79f0a03d105c7cc2c66805e164f68d77d92c /db
parent6974ffffd292657d8257826b2e09a0a8fff6c6a8 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20231127171903_remove_application_settings_columns.rb23
-rw-r--r--db/post_migrate/20231202175941_index_projects_on_organization_id_and_id.rb19
-rw-r--r--db/post_migrate/20231202180101_remove_index_on_organization_id_projects_table.rb16
-rw-r--r--db/schema_migrations/202311271719031
-rw-r--r--db/schema_migrations/202312021759411
-rw-r--r--db/schema_migrations/202312021801011
-rw-r--r--db/structure.sql6
7 files changed, 62 insertions, 5 deletions
diff --git a/db/post_migrate/20231127171903_remove_application_settings_columns.rb b/db/post_migrate/20231127171903_remove_application_settings_columns.rb
new file mode 100644
index 00000000000..9400c036678
--- /dev/null
+++ b/db/post_migrate/20231127171903_remove_application_settings_columns.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class RemoveApplicationSettingsColumns < Gitlab::Database::Migration[2.2]
+ milestone '16.7'
+
+ disable_ddl_transaction!
+
+ def up
+ remove_column :application_settings, :elasticsearch_shards, if_exists: true
+ remove_column :application_settings, :elasticsearch_replicas, if_exists: true
+ remove_column :application_settings, :static_objects_external_storage_auth_token, if_exists: true
+ remove_column :application_settings, :web_ide_clientside_preview_enabled, if_exists: true
+ end
+
+ def down
+ add_column :application_settings, :elasticsearch_shards, :integer, default: 5, null: false, if_not_exists: true
+ add_column :application_settings, :elasticsearch_replicas, :integer, default: 1, null: false, if_not_exists: true
+ add_column :application_settings, :static_objects_external_storage_auth_token, :string, limit: 255,
+ if_not_exists: true
+ add_column :application_settings, :web_ide_clientside_preview_enabled, :boolean, default: false, null: false,
+ if_not_exists: true
+ end
+end
diff --git a/db/post_migrate/20231202175941_index_projects_on_organization_id_and_id.rb b/db/post_migrate/20231202175941_index_projects_on_organization_id_and_id.rb
new file mode 100644
index 00000000000..a536def7ff3
--- /dev/null
+++ b/db/post_migrate/20231202175941_index_projects_on_organization_id_and_id.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class IndexProjectsOnOrganizationIdAndId < Gitlab::Database::Migration[2.2]
+ milestone '16.7'
+ disable_ddl_transaction!
+
+ INDEX_NAME = "index_projects_on_organization_id_and_id"
+
+ def up
+ # rubocop:disable Migration/PreventIndexCreation -- Replacing existing index
+ # on organization_id with an index on (organization_id, id)
+ add_concurrent_index :projects, [:organization_id, :id], name: INDEX_NAME
+ # rubocop:enable Migration/PreventIndexCreation
+ end
+
+ def down
+ remove_concurrent_index :projects, [:organization_id, :id], name: INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20231202180101_remove_index_on_organization_id_projects_table.rb b/db/post_migrate/20231202180101_remove_index_on_organization_id_projects_table.rb
new file mode 100644
index 00000000000..ec5a6d33ca3
--- /dev/null
+++ b/db/post_migrate/20231202180101_remove_index_on_organization_id_projects_table.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class RemoveIndexOnOrganizationIdProjectsTable < Gitlab::Database::Migration[2.2]
+ milestone '16.7'
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_projects_on_organization_id'
+
+ def up
+ remove_concurrent_index_by_name :projects, INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index :projects, :organization_id, name: INDEX_NAME
+ end
+end
diff --git a/db/schema_migrations/20231127171903 b/db/schema_migrations/20231127171903
new file mode 100644
index 00000000000..6053f0eee23
--- /dev/null
+++ b/db/schema_migrations/20231127171903
@@ -0,0 +1 @@
+af73341ffb326a6e9d4f6b6aa836f5888182278626f51cc193f5ca906c4ccf4e \ No newline at end of file
diff --git a/db/schema_migrations/20231202175941 b/db/schema_migrations/20231202175941
new file mode 100644
index 00000000000..2474832a918
--- /dev/null
+++ b/db/schema_migrations/20231202175941
@@ -0,0 +1 @@
+8d752179a1544a0dad7c1df99ed332002b8ebd0191d3ae7434366267e227987f \ No newline at end of file
diff --git a/db/schema_migrations/20231202180101 b/db/schema_migrations/20231202180101
new file mode 100644
index 00000000000..66c6cb84ffd
--- /dev/null
+++ b/db/schema_migrations/20231202180101
@@ -0,0 +1 @@
+432843177f4e67613b94bd24de3ab6903d4295a591545247ca7c264c18720ad6 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 270c6508743..d10eb687c32 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -11873,7 +11873,6 @@ CREATE TABLE application_settings (
snowplow_enabled boolean DEFAULT false NOT NULL,
snowplow_collector_hostname character varying,
snowplow_cookie_domain character varying,
- web_ide_clientside_preview_enabled boolean DEFAULT false NOT NULL,
user_show_add_ssh_key_message boolean DEFAULT true NOT NULL,
custom_project_templates_group_id integer,
usage_stats_set_by_user_id integer,
@@ -11890,8 +11889,6 @@ CREATE TABLE application_settings (
lets_encrypt_notification_email character varying,
lets_encrypt_terms_of_service_accepted boolean DEFAULT false NOT NULL,
geo_node_allowed_ips character varying DEFAULT '0.0.0.0/0, ::/0'::character varying,
- elasticsearch_shards integer DEFAULT 5 NOT NULL,
- elasticsearch_replicas integer DEFAULT 1 NOT NULL,
encrypted_lets_encrypt_private_key text,
encrypted_lets_encrypt_private_key_iv text,
required_instance_ci_template character varying,
@@ -11912,7 +11909,6 @@ CREATE TABLE application_settings (
encrypted_asset_proxy_secret_key text,
encrypted_asset_proxy_secret_key_iv character varying,
static_objects_external_storage_url character varying(255),
- static_objects_external_storage_auth_token character varying(255),
max_personal_access_token_lifetime integer,
throttle_protected_paths_enabled boolean DEFAULT false NOT NULL,
throttle_protected_paths_requests_per_period integer DEFAULT 10 NOT NULL,
@@ -34198,7 +34194,7 @@ CREATE INDEX index_projects_on_namespace_id_and_id ON projects USING btree (name
CREATE INDEX index_projects_on_namespace_id_and_repository_size_limit ON projects USING btree (namespace_id, repository_size_limit);
-CREATE INDEX index_projects_on_organization_id ON projects USING btree (organization_id);
+CREATE INDEX index_projects_on_organization_id_and_id ON projects USING btree (organization_id, id);
CREATE INDEX index_projects_on_path_trigram ON projects USING gin (path gin_trgm_ops);