diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-17 09:08:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-17 09:08:24 +0300 |
commit | 3974bc83f3bfc8a7757dcac0319e966042dc4356 (patch) | |
tree | 784130df5c94e3652259c8cd433468c454c733ce /db | |
parent | 620e22ef03af2978c215573603a3911bb7f0c3fb (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/fixtures/development/04_labels.rb | 4 | ||||
-rw-r--r-- | db/fixtures/development/33_triage_ops.rb | 4 | ||||
-rw-r--r-- | db/post_migrate/20220510003916_remove_tmp_empty_traversal_ids_root_namespace_index.rb | 16 | ||||
-rw-r--r-- | db/post_migrate/20220510004501_remove_tmp_empty_traversal_ids_child_namespace_index.rb | 16 | ||||
-rw-r--r-- | db/schema_migrations/20220510003916 | 1 | ||||
-rw-r--r-- | db/schema_migrations/20220510004501 | 1 | ||||
-rw-r--r-- | db/structure.sql | 4 |
7 files changed, 38 insertions, 8 deletions
diff --git a/db/fixtures/development/04_labels.rb b/db/fixtures/development/04_labels.rb index aff8331a191..5f0d7f2d8be 100644 --- a/db/fixtures/development/04_labels.rb +++ b/db/fixtures/development/04_labels.rb @@ -12,7 +12,7 @@ class Gitlab::Seeder::GroupLabels @label_per_group.times do label_title = FFaker::Product.brand Labels::CreateService - .new(title: label_title, color: "##{Digest::MD5.hexdigest(label_title)[0..5]}") + .new(title: label_title, color: "#{::Gitlab::Color.color_for(label_title)}") .execute(group: @group) print '.' end @@ -29,7 +29,7 @@ class Gitlab::Seeder::ProjectLabels @label_per_project.times do label_title = FFaker::Vehicle.model Labels::CreateService - .new(title: label_title, color: "##{Digest::MD5.hexdigest(label_title)[0..5]}") + .new(title: label_title, color: "#{::Gitlab::Color.color_for(label_title)}") .execute(project: @project) print '.' end diff --git a/db/fixtures/development/33_triage_ops.rb b/db/fixtures/development/33_triage_ops.rb index 9b9f800f678..aaf92315125 100644 --- a/db/fixtures/development/33_triage_ops.rb +++ b/db/fixtures/development/33_triage_ops.rb @@ -111,10 +111,10 @@ class Gitlab::Seeder::TriageOps group = Group.find_by_full_path(group_path) label_titles.each do |label_title| - color = Digest::MD5.hexdigest(label_title[/[^:]+/])[0..5] + color = ::Gitlab::Color.color_for(label_title[/[^:]+/]) Labels::CreateService - .new(title: label_title, color: "##{color}") + .new(title: label_title, color: "#{color}") .execute(group: group) end end diff --git a/db/post_migrate/20220510003916_remove_tmp_empty_traversal_ids_root_namespace_index.rb b/db/post_migrate/20220510003916_remove_tmp_empty_traversal_ids_root_namespace_index.rb new file mode 100644 index 00000000000..424c6f164e7 --- /dev/null +++ b/db/post_migrate/20220510003916_remove_tmp_empty_traversal_ids_root_namespace_index.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class RemoveTmpEmptyTraversalIdsRootNamespaceIndex < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + ROOT_NS_INDEX_NAME = 'tmp_index_namespaces_empty_traversal_ids_with_root_namespaces' + + def up + remove_concurrent_index :namespaces, :id, name: ROOT_NS_INDEX_NAME + end + + def down + where_sql = "parent_id IS NULL AND traversal_ids = '{}'" + add_concurrent_index :namespaces, :id, where: where_sql, name: ROOT_NS_INDEX_NAME + end +end diff --git a/db/post_migrate/20220510004501_remove_tmp_empty_traversal_ids_child_namespace_index.rb b/db/post_migrate/20220510004501_remove_tmp_empty_traversal_ids_child_namespace_index.rb new file mode 100644 index 00000000000..804b20a38e9 --- /dev/null +++ b/db/post_migrate/20220510004501_remove_tmp_empty_traversal_ids_child_namespace_index.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class RemoveTmpEmptyTraversalIdsChildNamespaceIndex < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + CHILD_INDEX_NAME = 'tmp_index_namespaces_empty_traversal_ids_with_child_namespaces' + + def up + remove_concurrent_index :namespaces, :id, name: CHILD_INDEX_NAME + end + + def down + where_sql = "parent_id IS NOT NULL AND traversal_ids = '{}'" + add_concurrent_index :namespaces, :id, where: where_sql, name: CHILD_INDEX_NAME + end +end diff --git a/db/schema_migrations/20220510003916 b/db/schema_migrations/20220510003916 new file mode 100644 index 00000000000..35584f5f55f --- /dev/null +++ b/db/schema_migrations/20220510003916 @@ -0,0 +1 @@ +ccafdc28ff28fc758fe67084f3a837c72f91470467bda2acdb6282de89b46e34
\ No newline at end of file diff --git a/db/schema_migrations/20220510004501 b/db/schema_migrations/20220510004501 new file mode 100644 index 00000000000..6342258af5d --- /dev/null +++ b/db/schema_migrations/20220510004501 @@ -0,0 +1 @@ +ef9c231a917e4beacff9689c4bbfea0885c4223d3d8b59823a5ffac7f3b2364f
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 9e610e27904..1a226e1020b 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -29768,10 +29768,6 @@ CREATE INDEX tmp_index_members_on_state ON members USING btree (state) WHERE (st CREATE INDEX tmp_index_merge_requests_draft_and_status ON merge_requests USING btree (id) WHERE ((draft = false) AND (state_id = 1) AND ((title)::text ~* '^(\[draft\]|\(draft\)|draft:|draft|\[WIP\]|WIP:|WIP)'::text)); -CREATE INDEX tmp_index_namespaces_empty_traversal_ids_with_child_namespaces ON namespaces USING btree (id) WHERE ((parent_id IS NOT NULL) AND (traversal_ids = '{}'::integer[])); - -CREATE INDEX tmp_index_namespaces_empty_traversal_ids_with_root_namespaces ON namespaces USING btree (id) WHERE ((parent_id IS NULL) AND (traversal_ids = '{}'::integer[])); - CREATE UNIQUE INDEX tmp_index_on_tmp_project_id_on_namespaces ON namespaces USING btree (tmp_project_id); CREATE INDEX tmp_index_on_vulnerabilities_non_dismissed ON vulnerabilities USING btree (id) WHERE (state <> 2); |