diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-17 15:12:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-17 15:12:30 +0300 |
commit | 70c5d7928283b1386ab26a93d68015e9591ae4b7 (patch) | |
tree | 2825384d59e566bb61478d76086abd98f230120d /db | |
parent | 5e11fc146aba1344ad95f7fea1a99db82f0f68f2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20220208170445_add_not_valid_foreign_key_to_ci_builds_runner_id.rb | 15 | ||||
-rw-r--r-- | db/schema_migrations/20220208170445 | 1 | ||||
-rw-r--r-- | db/structure.sql | 3 |
3 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20220208170445_add_not_valid_foreign_key_to_ci_builds_runner_id.rb b/db/migrate/20220208170445_add_not_valid_foreign_key_to_ci_builds_runner_id.rb new file mode 100644 index 00000000000..9b2ba17e068 --- /dev/null +++ b/db/migrate/20220208170445_add_not_valid_foreign_key_to_ci_builds_runner_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddNotValidForeignKeyToCiBuildsRunnerId < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :ci_builds, :ci_runners, column: :runner_id, on_delete: :nullify, validate: false + end + + def down + with_lock_retries do + remove_foreign_key_if_exists :ci_builds, column: :runner_id + end + end +end diff --git a/db/schema_migrations/20220208170445 b/db/schema_migrations/20220208170445 new file mode 100644 index 00000000000..3a486a586a8 --- /dev/null +++ b/db/schema_migrations/20220208170445 @@ -0,0 +1 @@ +e00dd618ca393596f3ff05b44b1a9a36183729a864a5cf4b8f1a262dfcdb932b
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 04cd900b364..763a4cf51be 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -30140,6 +30140,9 @@ ALTER TABLE ONLY ci_builds_metadata ALTER TABLE ONLY gitlab_subscriptions ADD CONSTRAINT fk_e2595d00a1 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_builds + ADD CONSTRAINT fk_e4ef9c2f27 FOREIGN KEY (runner_id) REFERENCES ci_runners(id) ON DELETE SET NULL NOT VALID; + ALTER TABLE ONLY merge_requests ADD CONSTRAINT fk_e719a85f8a FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; |