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-06-02 03:07:05 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-06-02 03:07:05 +0300
commit3ae3a2c23f5347493fc2842421941d56cb9545d6 (patch)
treeb4b4e9662f31864cbae0d20e428e3a51b7bd5ba7 /db
parent3ddb72a5ab59d56cb9e9cb27a5abb92bc5074544 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20230524150232_remove_index_user_details_on_user_id_for_enterprise_users_without_date.rb19
-rw-r--r--db/post_migrate/20230524150438_remove_index_user_details_on_user_id_for_enterprise_users_with_date.rb19
-rw-r--r--db/schema_migrations/202305241502321
-rw-r--r--db/schema_migrations/202305241504381
-rw-r--r--db/structure.sql4
5 files changed, 40 insertions, 4 deletions
diff --git a/db/post_migrate/20230524150232_remove_index_user_details_on_user_id_for_enterprise_users_without_date.rb b/db/post_migrate/20230524150232_remove_index_user_details_on_user_id_for_enterprise_users_without_date.rb
new file mode 100644
index 00000000000..d1c56af1721
--- /dev/null
+++ b/db/post_migrate/20230524150232_remove_index_user_details_on_user_id_for_enterprise_users_without_date.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class RemoveIndexUserDetailsOnUserIdForEnterpriseUsersWithoutDate < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_user_details_on_user_id_for_enterprise_users_without_date'
+
+ disable_ddl_transaction!
+
+ def up
+ remove_concurrent_index_by_name :user_details, INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index(
+ :user_details, :user_id,
+ where: 'provisioned_by_group_id IS NOT NULL AND provisioned_by_group_at IS NULL',
+ name: INDEX_NAME
+ )
+ end
+end
diff --git a/db/post_migrate/20230524150438_remove_index_user_details_on_user_id_for_enterprise_users_with_date.rb b/db/post_migrate/20230524150438_remove_index_user_details_on_user_id_for_enterprise_users_with_date.rb
new file mode 100644
index 00000000000..350c72ce20b
--- /dev/null
+++ b/db/post_migrate/20230524150438_remove_index_user_details_on_user_id_for_enterprise_users_with_date.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class RemoveIndexUserDetailsOnUserIdForEnterpriseUsersWithDate < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_user_details_on_user_id_for_enterprise_users_with_date'
+
+ disable_ddl_transaction!
+
+ def up
+ remove_concurrent_index_by_name :user_details, INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index(
+ :user_details, :user_id,
+ where: 'provisioned_by_group_id IS NOT NULL AND provisioned_by_group_at IS NOT NULL',
+ name: INDEX_NAME
+ )
+ end
+end
diff --git a/db/schema_migrations/20230524150232 b/db/schema_migrations/20230524150232
new file mode 100644
index 00000000000..c25f1a6ab47
--- /dev/null
+++ b/db/schema_migrations/20230524150232
@@ -0,0 +1 @@
+073d817772476d9d32fa623547fb711c9e6890f507b974272fe8bca4e5c17a83 \ No newline at end of file
diff --git a/db/schema_migrations/20230524150438 b/db/schema_migrations/20230524150438
new file mode 100644
index 00000000000..0e4efed2240
--- /dev/null
+++ b/db/schema_migrations/20230524150438
@@ -0,0 +1 @@
+093e6faef2171b8d7ab75bc096cfe140d5c595f113a911ca000529cf66f6eb6d \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index faec2494dd1..78185f381d4 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -32755,10 +32755,6 @@ COMMENT ON INDEX index_user_details_on_phone IS 'JiHu-specific index';
CREATE UNIQUE INDEX index_user_details_on_user_id ON user_details USING btree (user_id);
-CREATE INDEX index_user_details_on_user_id_for_enterprise_users_with_date ON user_details USING btree (user_id) WHERE ((provisioned_by_group_id IS NOT NULL) AND (provisioned_by_group_at IS NOT NULL));
-
-CREATE INDEX index_user_details_on_user_id_for_enterprise_users_without_date ON user_details USING btree (user_id) WHERE ((provisioned_by_group_id IS NOT NULL) AND (provisioned_by_group_at IS NULL));
-
CREATE INDEX index_user_group_callouts_on_group_id ON user_group_callouts USING btree (group_id);
CREATE INDEX index_user_highest_roles_on_user_id_and_highest_access_level ON user_highest_roles USING btree (user_id, highest_access_level);