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-05-30 21:08:01 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-30 21:08:01 +0300
commit2655ac9cd596526f2ea89a86e4f615139ee40fc4 (patch)
tree7347acf40d1f2aa6bcd928334cea4d2d0df7b6ad /db
parentaad78b57896307fff73539719d510a8c82be77f9 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20230512104238_add_audit_events_group_index.rb19
-rw-r--r--db/schema_migrations/202305121042381
-rw-r--r--db/structure.sql2
3 files changed, 22 insertions, 0 deletions
diff --git a/db/post_migrate/20230512104238_add_audit_events_group_index.rb b/db/post_migrate/20230512104238_add_audit_events_group_index.rb
new file mode 100644
index 00000000000..d1d7e5f26fc
--- /dev/null
+++ b/db/post_migrate/20230512104238_add_audit_events_group_index.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddAuditEventsGroupIndex < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::PartitioningMigrationHelpers
+
+ TABLE_NAME = :audit_events
+ COLUMN_NAMES = [:entity_id, :entity_type, :created_at, :id]
+ INDEX_NAME = 'index_audit_events_on_entity_id_and_entity_type_and_created_at'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_partitioned_index(TABLE_NAME, COLUMN_NAMES, name: INDEX_NAME)
+ end
+
+ def down
+ remove_concurrent_partitioned_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+end
diff --git a/db/schema_migrations/20230512104238 b/db/schema_migrations/20230512104238
new file mode 100644
index 00000000000..7147448d13e
--- /dev/null
+++ b/db/schema_migrations/20230512104238
@@ -0,0 +1 @@
+db35cec0252dc30e2de62c9d61c0230d603f5714a986412d8a5ebdc2d9c0a1d5 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index a23d01c628e..50b15accfc5 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -29822,6 +29822,8 @@ CREATE UNIQUE INDEX index_atlassian_identities_on_extern_uid ON atlassian_identi
CREATE UNIQUE INDEX index_audit_events_external_audit_on_verification_token ON audit_events_external_audit_event_destinations USING btree (verification_token);
+CREATE INDEX index_audit_events_on_entity_id_and_entity_type_and_created_at ON ONLY audit_events USING btree (entity_id, entity_type, created_at, id);
+
CREATE INDEX index_authentication_events_on_provider ON authentication_events USING btree (provider);
CREATE INDEX index_authentication_events_on_user_and_ip_address_and_result ON authentication_events USING btree (user_id, ip_address, result);