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-19 12:10:52 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-12-19 12:10:52 +0300
commit17295c75a1a28df78f719e0098dd31fe45ce0446 (patch)
tree0544bd2f74e72e45b4a62ff68a4736c26a02a832 /db
parent6c2b987064064500b42da924d86d43473bfd2b7f (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/docs/batched_background_migrations/update_workspaces_config_version.yml3
-rw-r--r--db/migrate/20231130124606_add_project_id_name_version_id_index_to_installable_terraform_modules.rb23
-rw-r--r--db/post_migrate/20231215151348_finalize_workspaces_config_version_2_migration.rb23
-rw-r--r--db/schema_migrations/202311301246061
-rw-r--r--db/schema_migrations/202312151513481
-rw-r--r--db/structure.sql2
6 files changed, 53 insertions, 0 deletions
diff --git a/db/docs/batched_background_migrations/update_workspaces_config_version.yml b/db/docs/batched_background_migrations/update_workspaces_config_version.yml
index ead063ebed6..4ccddd5017a 100644
--- a/db/docs/batched_background_migrations/update_workspaces_config_version.yml
+++ b/db/docs/batched_background_migrations/update_workspaces_config_version.yml
@@ -3,3 +3,6 @@ description: Update config_version to 2 and force_include_all_resources to true
feature_category: remote_development
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/131402
milestone: '16.5'
+queued_migration_version: 20230910120000
+finalize_after: "2023-11-15"
+finalized_by: 20231215151348
diff --git a/db/migrate/20231130124606_add_project_id_name_version_id_index_to_installable_terraform_modules.rb b/db/migrate/20231130124606_add_project_id_name_version_id_index_to_installable_terraform_modules.rb
new file mode 100644
index 00000000000..0b305843bd5
--- /dev/null
+++ b/db/migrate/20231130124606_add_project_id_name_version_id_index_to_installable_terraform_modules.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class AddProjectIdNameVersionIdIndexToInstallableTerraformModules < Gitlab::Database::Migration[2.2]
+ milestone '16.7'
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'idx_pkgs_on_project_id_name_version_on_installable_terraform'
+ PACKAGE_TYPE_TERRAFORM_MODULE = 12
+ INSTALLABLE_CONDITION = 'status IN (0, 1)'
+
+ def up
+ add_concurrent_index(
+ :packages_packages,
+ %i[project_id name version id],
+ name: INDEX_NAME,
+ where: "package_type = #{PACKAGE_TYPE_TERRAFORM_MODULE} AND #{INSTALLABLE_CONDITION}"
+ )
+ end
+
+ def down
+ remove_concurrent_index_by_name(:packages_packages, INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20231215151348_finalize_workspaces_config_version_2_migration.rb b/db/post_migrate/20231215151348_finalize_workspaces_config_version_2_migration.rb
new file mode 100644
index 00000000000..c76bc15d778
--- /dev/null
+++ b/db/post_migrate/20231215151348_finalize_workspaces_config_version_2_migration.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class FinalizeWorkspacesConfigVersion2Migration < Gitlab::Database::Migration[2.2]
+ milestone '16.8'
+ MIGRATION = 'UpdateWorkspacesConfigVersion'
+ disable_ddl_transaction!
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ ensure_batched_background_migration_is_finished(
+ job_class_name: MIGRATION,
+ table_name: :workspaces,
+ column_name: :id,
+ job_arguments: [],
+ finalize: true
+ )
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/schema_migrations/20231130124606 b/db/schema_migrations/20231130124606
new file mode 100644
index 00000000000..ed5744a8c7e
--- /dev/null
+++ b/db/schema_migrations/20231130124606
@@ -0,0 +1 @@
+70f8264aa0996e3020fd068beba148f51170224126d1aa91740bd32bd59a196d \ No newline at end of file
diff --git a/db/schema_migrations/20231215151348 b/db/schema_migrations/20231215151348
new file mode 100644
index 00000000000..1c37bec18da
--- /dev/null
+++ b/db/schema_migrations/20231215151348
@@ -0,0 +1 @@
+281fde69710c20f9ae845136a4bfdbce1a8396f3d3d17018f7ffce1bf230b888 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 3ed12685706..754c8139b37 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -31675,6 +31675,8 @@ CREATE INDEX idx_pkgs_installable_package_files_on_package_id_id_file_name ON pa
CREATE INDEX idx_pkgs_npm_metadata_caches_on_id_and_project_id_and_status ON packages_npm_metadata_caches USING btree (id) WHERE ((project_id IS NULL) AND (status = 0));
+CREATE INDEX idx_pkgs_on_project_id_name_version_on_installable_terraform ON packages_packages USING btree (project_id, name, version, id) WHERE ((package_type = 12) AND (status = ANY (ARRAY[0, 1])));
+
CREATE INDEX idx_proj_feat_usg_on_jira_dvcs_cloud_last_sync_at_and_proj_id ON project_feature_usages USING btree (jira_dvcs_cloud_last_sync_at, project_id) WHERE (jira_dvcs_cloud_last_sync_at IS NOT NULL);
CREATE INDEX idx_proj_feat_usg_on_jira_dvcs_server_last_sync_at_and_proj_id ON project_feature_usages USING btree (jira_dvcs_server_last_sync_at, project_id) WHERE (jira_dvcs_server_last_sync_at IS NOT NULL);