diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-25 15:11:37 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-25 15:11:37 +0300 |
commit | 65111966f576732f77dc18095635abac0aa8e77a (patch) | |
tree | 718801f1a41bf02d618447dec9cd84e04d502fc4 | |
parent | 4c8b8da7ab73f6312cf47c0404ca2153e43be9a0 (diff) |
Add latest changes from gitlab-org/gitlab@master
4 files changed, 29 insertions, 4 deletions
diff --git a/app/services/projects/update_repository_storage_service.rb b/app/services/projects/update_repository_storage_service.rb index a9f6afb26c9..e727181666e 100644 --- a/app/services/projects/update_repository_storage_service.rb +++ b/app/services/projects/update_repository_storage_service.rb @@ -9,7 +9,7 @@ module Projects private def track_repository(destination_storage_name) - project.update!(repository_storage: destination_storage_name) + project.update_column(:repository_storage, destination_storage_name) # Connect project to pool repository from the new shard project.swap_pool_repository! diff --git a/db/migrate/20231123165947_change_fk_to_member_role_on_members_from_cascade_to_nullify.rb b/db/migrate/20231123165947_change_fk_to_member_role_on_members_from_cascade_to_nullify.rb new file mode 100644 index 00000000000..c0b4ada822d --- /dev/null +++ b/db/migrate/20231123165947_change_fk_to_member_role_on_members_from_cascade_to_nullify.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class ChangeFkToMemberRoleOnMembersFromCascadeToNullify < Gitlab::Database::Migration[2.2] + milestone '16.7' + disable_ddl_transaction! + + FK_NAME = 'fk_member_role_on_members' + + def up + add_concurrent_foreign_key :members, :member_roles, column: :member_role_id, on_delete: :nullify, name: FK_NAME + + with_lock_retries do + remove_foreign_key :members, column: :member_role_id + end + end + + def down + add_concurrent_foreign_key :members, :member_roles, column: :member_role_id, on_delete: :cascade + + with_lock_retries do + remove_foreign_key :members, column: :member_role_id, name: FK_NAME + end + end +end diff --git a/db/schema_migrations/20231123165947 b/db/schema_migrations/20231123165947 new file mode 100644 index 00000000000..d31c7a016cd --- /dev/null +++ b/db/schema_migrations/20231123165947 @@ -0,0 +1 @@ +f4482264a2b44574972bf63781b73ec9e2bfc602ef681bfca443927b4b6a6eb1
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 0fd47d9b0d4..d7ba2e8a755 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -37422,9 +37422,6 @@ ALTER TABLE ONLY dast_scanner_profiles_builds ALTER TABLE ONLY issue_assignees ADD CONSTRAINT fk_5e0c8d9154 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; -ALTER TABLE ONLY members - ADD CONSTRAINT fk_5e12d50db3 FOREIGN KEY (member_role_id) REFERENCES member_roles(id) ON DELETE CASCADE; - ALTER TABLE ONLY csv_issue_imports ADD CONSTRAINT fk_5e1572387c FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -38181,6 +38178,9 @@ ALTER TABLE ONLY issues ALTER TABLE ONLY geo_event_log ADD CONSTRAINT fk_geo_event_log_on_geo_event_id FOREIGN KEY (geo_event_id) REFERENCES geo_events(id) ON DELETE CASCADE; +ALTER TABLE ONLY members + ADD CONSTRAINT fk_member_role_on_members FOREIGN KEY (member_role_id) REFERENCES member_roles(id) ON DELETE SET NULL; + ALTER TABLE ONLY ml_candidate_metrics ADD CONSTRAINT fk_ml_candidate_metrics_on_candidate_id FOREIGN KEY (candidate_id) REFERENCES ml_candidates(id) ON DELETE CASCADE; |