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>2020-11-30 21:09:46 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-11-30 21:09:46 +0300
commitace0df53d3ed38344b470727d430484d24eeb798 (patch)
treeec1fc71d793bf3d588df9fe97c4649c87e697e73 /db
parent56eafa995d0bbda39bc24cd07537286bf36a4dd9 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20201119125730_add_web_hooks_service_foreign_key.rb23
-rw-r--r--db/schema_migrations/202011191257301
-rw-r--r--db/structure.sql5
3 files changed, 29 insertions, 0 deletions
diff --git a/db/migrate/20201119125730_add_web_hooks_service_foreign_key.rb b/db/migrate/20201119125730_add_web_hooks_service_foreign_key.rb
new file mode 100644
index 00000000000..d350a7de282
--- /dev/null
+++ b/db/migrate/20201119125730_add_web_hooks_service_foreign_key.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class AddWebHooksServiceForeignKey < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ INDEX_NAME = 'index_web_hooks_on_service_id'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :web_hooks, :service_id, name: INDEX_NAME
+ add_concurrent_foreign_key :web_hooks, :services, column: :service_id, on_delete: :cascade, validate: false
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key_if_exists :web_hooks, column: :service_id
+ end
+
+ remove_concurrent_index_by_name :web_hooks, INDEX_NAME
+ end
+end
diff --git a/db/schema_migrations/20201119125730 b/db/schema_migrations/20201119125730
new file mode 100644
index 00000000000..39de483e890
--- /dev/null
+++ b/db/schema_migrations/20201119125730
@@ -0,0 +1 @@
+9fb3c338c999617b40e4c63f24ea037b5b1403354b93c2117e028ad8348d96aa \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index beb05a5c5e6..d99e6a8c2ca 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -22528,6 +22528,8 @@ CREATE INDEX index_web_hooks_on_group_id ON web_hooks USING btree (group_id) WHE
CREATE INDEX index_web_hooks_on_project_id ON web_hooks USING btree (project_id);
+CREATE INDEX index_web_hooks_on_service_id ON web_hooks USING btree (service_id);
+
CREATE INDEX index_web_hooks_on_type ON web_hooks USING btree (type);
CREATE UNIQUE INDEX index_webauthn_registrations_on_credential_xid ON webauthn_registrations USING btree (credential_xid);
@@ -23398,6 +23400,9 @@ ALTER TABLE ONLY environments
ALTER TABLE ONLY ci_builds
ADD CONSTRAINT fk_d3130c9a7f FOREIGN KEY (commit_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
+ALTER TABLE ONLY web_hooks
+ ADD CONSTRAINT fk_d47999a98a FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE NOT VALID;
+
ALTER TABLE ONLY ci_sources_pipelines
ADD CONSTRAINT fk_d4e29af7d7 FOREIGN KEY (source_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;