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>2021-01-27 18:09:15 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-01-27 18:09:15 +0300
commit0cbb4a75699e1ab6a0cb704b551e672e09192377 (patch)
tree3464aa858cfe0051bf898c919c097905c9f5f8da /db
parent507c0e71cd73201beadf9c5e1e0361fc8e9e2665 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20210126091713_add_unique_index_services_project_id_and_type.rb19
-rw-r--r--db/migrate/20210126092102_remove_index_services_project_id_and_type.rb20
-rw-r--r--db/schema_migrations/202101260917131
-rw-r--r--db/schema_migrations/202101260921021
-rw-r--r--db/structure.sql2
5 files changed, 42 insertions, 1 deletions
diff --git a/db/migrate/20210126091713_add_unique_index_services_project_id_and_type.rb b/db/migrate/20210126091713_add_unique_index_services_project_id_and_type.rb
new file mode 100644
index 00000000000..272dca70a8b
--- /dev/null
+++ b/db/migrate/20210126091713_add_unique_index_services_project_id_and_type.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddUniqueIndexServicesProjectIdAndType < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_services_on_project_id_and_type_unique'
+
+ def up
+ add_concurrent_index :services, [:project_id, :type], name: INDEX_NAME, unique: true
+ end
+
+ def down
+ remove_concurrent_index_by_name :services, name: INDEX_NAME
+ end
+end
diff --git a/db/migrate/20210126092102_remove_index_services_project_id_and_type.rb b/db/migrate/20210126092102_remove_index_services_project_id_and_type.rb
new file mode 100644
index 00000000000..49780d03b7b
--- /dev/null
+++ b/db/migrate/20210126092102_remove_index_services_project_id_and_type.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class RemoveIndexServicesProjectIdAndType < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_services_on_project_id_and_type'
+
+ # Replaced by the index added in 20210126091713_add_unique_index_services_project_id_and_type.rb
+ def up
+ remove_concurrent_index_by_name :services, name: INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index :services, [:project_id, :type], name: INDEX_NAME
+ end
+end
diff --git a/db/schema_migrations/20210126091713 b/db/schema_migrations/20210126091713
new file mode 100644
index 00000000000..b75636bd437
--- /dev/null
+++ b/db/schema_migrations/20210126091713
@@ -0,0 +1 @@
+3906739d07514e6e59f79a4a81d28859a2481614a299c95ec1b1d9825a07ec64 \ No newline at end of file
diff --git a/db/schema_migrations/20210126092102 b/db/schema_migrations/20210126092102
new file mode 100644
index 00000000000..803643389f6
--- /dev/null
+++ b/db/schema_migrations/20210126092102
@@ -0,0 +1 @@
+124c5ae1a1ccade5dec01f72b726e03febc8f56411d7d8990f976bb2a9516037 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 21035098449..bae7dc05122 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -23003,7 +23003,7 @@ CREATE INDEX index_service_desk_enabled_projects_on_id_creator_id_created_at ON
CREATE INDEX index_services_on_inherit_from_id ON services USING btree (inherit_from_id);
-CREATE INDEX index_services_on_project_id_and_type ON services USING btree (project_id, type);
+CREATE UNIQUE INDEX index_services_on_project_id_and_type_unique ON services USING btree (project_id, type);
CREATE INDEX index_services_on_template ON services USING btree (template);