diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-16 21:09:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-16 21:09:42 +0300 |
commit | c44eade0d7b09c9d80c42aba6d1974ce9cd3146b (patch) | |
tree | da0710de0a519f225755737cf5ffd93c75d1da8f /db | |
parent | 0c87da93750c6428328a3e3cd2ebd0882f6294e3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
25 files changed, 504 insertions, 40 deletions
diff --git a/db/post_migrate/20230615083713_replace_old_fk_ci_build_pending_states_to_builds.rb b/db/post_migrate/20230615083713_replace_old_fk_ci_build_pending_states_to_builds.rb new file mode 100644 index 00000000000..82d88888442 --- /dev/null +++ b/db/post_migrate/20230615083713_replace_old_fk_ci_build_pending_states_to_builds.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +class ReplaceOldFkCiBuildPendingStatesToBuilds < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum + + disable_ddl_transaction! + + def up + return unless should_run? + return if new_foreign_key_exists? + + with_lock_retries do + remove_foreign_key_if_exists :ci_build_pending_states, :ci_builds, + name: :fk_861cd17da3_p, reverse_lock_order: true + + rename_constraint :ci_build_pending_states, :temp_fk_861cd17da3_p, :fk_861cd17da3_p + end + end + + def down + return unless should_run? + return unless new_foreign_key_exists? + + add_concurrent_foreign_key :ci_build_pending_states, :ci_builds, + name: :temp_fk_861cd17da3_p, + column: [:partition_id, :build_id], + target_column: [:partition_id, :id], + on_update: :cascade, + on_delete: :cascade, + validate: true, + reverse_lock_order: true + + switch_constraint_names :ci_build_pending_states, :fk_861cd17da3_p, :temp_fk_861cd17da3_p + end + + private + + def should_run? + can_execute_on?(:ci_build_pending_states, :ci_builds) + end + + def new_foreign_key_exists? + foreign_key_exists?(:ci_build_pending_states, :p_ci_builds, name: :fk_861cd17da3_p) + end +end diff --git a/db/post_migrate/20230615083715_replace_old_fk_ci_build_trace_chunks_to_builds.rb b/db/post_migrate/20230615083715_replace_old_fk_ci_build_trace_chunks_to_builds.rb new file mode 100644 index 00000000000..a5ca73e8124 --- /dev/null +++ b/db/post_migrate/20230615083715_replace_old_fk_ci_build_trace_chunks_to_builds.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +class ReplaceOldFkCiBuildTraceChunksToBuilds < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum + + disable_ddl_transaction! + + def up + return unless should_run? + return if new_foreign_key_exists? + + with_lock_retries do + remove_foreign_key_if_exists :ci_build_trace_chunks, :ci_builds, + name: :fk_89e29fa5ee_p, reverse_lock_order: true + + rename_constraint :ci_build_trace_chunks, :temp_fk_89e29fa5ee_p, :fk_89e29fa5ee_p + end + end + + def down + return unless should_run? + return unless new_foreign_key_exists? + + add_concurrent_foreign_key :ci_build_trace_chunks, :ci_builds, + name: :temp_fk_89e29fa5ee_p, + column: [:partition_id, :build_id], + target_column: [:partition_id, :id], + on_update: :cascade, + on_delete: :cascade, + validate: true, + reverse_lock_order: true + + switch_constraint_names :ci_build_trace_chunks, :fk_89e29fa5ee_p, :temp_fk_89e29fa5ee_p + end + + private + + def should_run? + can_execute_on?(:ci_build_trace_chunks, :ci_builds) + end + + def new_foreign_key_exists? + foreign_key_exists?(:ci_build_trace_chunks, :p_ci_builds, name: :fk_89e29fa5ee_p) + end +end diff --git a/db/post_migrate/20230615083720_replace_old_fk_ci_unit_test_failures_to_builds.rb b/db/post_migrate/20230615083720_replace_old_fk_ci_unit_test_failures_to_builds.rb new file mode 100644 index 00000000000..be527f7ae38 --- /dev/null +++ b/db/post_migrate/20230615083720_replace_old_fk_ci_unit_test_failures_to_builds.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +class ReplaceOldFkCiUnitTestFailuresToBuilds < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum + + disable_ddl_transaction! + + def up + return unless should_run? + return if new_foreign_key_exists? + + with_lock_retries do + remove_foreign_key_if_exists :ci_unit_test_failures, :ci_builds, + name: :fk_9e0fc58930_p, reverse_lock_order: true + + rename_constraint :ci_unit_test_failures, :temp_fk_9e0fc58930_p, :fk_9e0fc58930_p + end + end + + def down + return unless should_run? + return unless new_foreign_key_exists? + + add_concurrent_foreign_key :ci_unit_test_failures, :ci_builds, + name: :temp_fk_9e0fc58930_p, + column: [:partition_id, :build_id], + target_column: [:partition_id, :id], + on_update: :cascade, + on_delete: :cascade, + validate: true, + reverse_lock_order: true + + switch_constraint_names :ci_unit_test_failures, :fk_9e0fc58930_p, :temp_fk_9e0fc58930_p + end + + private + + def should_run? + can_execute_on?(:ci_unit_test_failures, :ci_builds) + end + + def new_foreign_key_exists? + foreign_key_exists?(:ci_unit_test_failures, :p_ci_builds, name: :fk_9e0fc58930_p) + end +end diff --git a/db/post_migrate/20230615083725_replace_old_fk_ci_sources_pipelines_to_builds.rb b/db/post_migrate/20230615083725_replace_old_fk_ci_sources_pipelines_to_builds.rb new file mode 100644 index 00000000000..990a4e2bbe4 --- /dev/null +++ b/db/post_migrate/20230615083725_replace_old_fk_ci_sources_pipelines_to_builds.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +class ReplaceOldFkCiSourcesPipelinesToBuilds < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum + + disable_ddl_transaction! + + def up + return unless should_run? + return if new_foreign_key_exists? + + with_lock_retries do + remove_foreign_key_if_exists :ci_sources_pipelines, :ci_builds, + name: :fk_be5624bf37_p, reverse_lock_order: true + + rename_constraint :ci_sources_pipelines, :temp_fk_be5624bf37_p, :fk_be5624bf37_p + end + end + + def down + return unless should_run? + return unless new_foreign_key_exists? + + add_concurrent_foreign_key :ci_sources_pipelines, :ci_builds, + name: :temp_fk_be5624bf37_p, + column: [:source_partition_id, :source_job_id], + target_column: [:partition_id, :id], + on_update: :cascade, + on_delete: :cascade, + validate: true, + reverse_lock_order: true + + switch_constraint_names :ci_sources_pipelines, :fk_be5624bf37_p, :temp_fk_be5624bf37_p + end + + private + + def should_run? + can_execute_on?(:ci_sources_pipelines, :ci_builds) + end + + def new_foreign_key_exists? + foreign_key_exists?(:ci_sources_pipelines, :p_ci_builds, name: :fk_be5624bf37_p) + end +end diff --git a/db/post_migrate/20230615083730_replace_old_fk_ci_resources_to_builds.rb b/db/post_migrate/20230615083730_replace_old_fk_ci_resources_to_builds.rb new file mode 100644 index 00000000000..498b513c425 --- /dev/null +++ b/db/post_migrate/20230615083730_replace_old_fk_ci_resources_to_builds.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +class ReplaceOldFkCiResourcesToBuilds < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum + + disable_ddl_transaction! + + def up + return unless should_run? + return if new_foreign_key_exists? + + with_lock_retries do + remove_foreign_key_if_exists :ci_resources, :ci_builds, + name: :fk_e169a8e3d5_p, reverse_lock_order: true + + rename_constraint :ci_resources, :temp_fk_e169a8e3d5_p, :fk_e169a8e3d5_p + end + end + + def down + return unless should_run? + return unless new_foreign_key_exists? + + add_concurrent_foreign_key :ci_resources, :ci_builds, + name: :temp_fk_e169a8e3d5_p, + column: [:partition_id, :build_id], + target_column: [:partition_id, :id], + on_update: :cascade, + on_delete: :nullify, + validate: true, + reverse_lock_order: true + + switch_constraint_names :ci_resources, :fk_e169a8e3d5_p, :temp_fk_e169a8e3d5_p + end + + private + + def should_run? + can_execute_on?(:ci_resources, :ci_builds) + end + + def new_foreign_key_exists? + foreign_key_exists?(:ci_resources, :p_ci_builds, name: :fk_e169a8e3d5_p) + end +end diff --git a/db/post_migrate/20230615083734_replace_old_fk_ci_build_report_results_to_builds.rb b/db/post_migrate/20230615083734_replace_old_fk_ci_build_report_results_to_builds.rb new file mode 100644 index 00000000000..24b51a45613 --- /dev/null +++ b/db/post_migrate/20230615083734_replace_old_fk_ci_build_report_results_to_builds.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +class ReplaceOldFkCiBuildReportResultsToBuilds < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum + + disable_ddl_transaction! + + def up + return unless should_run? + return if new_foreign_key_exists? + + with_lock_retries do + remove_foreign_key_if_exists :ci_build_report_results, :ci_builds, + name: :fk_rails_16cb1ff064_p, reverse_lock_order: true + + rename_constraint :ci_build_report_results, :temp_fk_rails_16cb1ff064_p, :fk_rails_16cb1ff064_p + end + end + + def down + return unless should_run? + return unless new_foreign_key_exists? + + add_concurrent_foreign_key :ci_build_report_results, :ci_builds, + name: :temp_fk_rails_16cb1ff064_p, + column: [:partition_id, :build_id], + target_column: [:partition_id, :id], + on_update: :cascade, + on_delete: :cascade, + validate: true, + reverse_lock_order: true + + switch_constraint_names :ci_build_report_results, :fk_rails_16cb1ff064_p, :temp_fk_rails_16cb1ff064_p + end + + private + + def should_run? + can_execute_on?(:ci_build_report_results, :ci_builds) + end + + def new_foreign_key_exists? + foreign_key_exists?(:ci_build_report_results, :p_ci_builds, name: :fk_rails_16cb1ff064_p) + end +end diff --git a/db/post_migrate/20230615083738_replace_old_fk_ci_build_needs_to_builds.rb b/db/post_migrate/20230615083738_replace_old_fk_ci_build_needs_to_builds.rb new file mode 100644 index 00000000000..4a77ec01551 --- /dev/null +++ b/db/post_migrate/20230615083738_replace_old_fk_ci_build_needs_to_builds.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +class ReplaceOldFkCiBuildNeedsToBuilds < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum + + disable_ddl_transaction! + + def up + return unless should_run? + return if new_foreign_key_exists? + + with_lock_retries do + remove_foreign_key_if_exists :ci_build_needs, :ci_builds, + name: :fk_rails_3cf221d4ed_p, reverse_lock_order: true + + rename_constraint :ci_build_needs, :temp_fk_rails_3cf221d4ed_p, :fk_rails_3cf221d4ed_p + end + end + + def down + return unless should_run? + return unless new_foreign_key_exists? + + add_concurrent_foreign_key :ci_build_needs, :ci_builds, + name: :temp_fk_rails_3cf221d4ed_p, + column: [:partition_id, :build_id], + target_column: [:partition_id, :id], + on_update: :cascade, + on_delete: :cascade, + validate: true, + reverse_lock_order: true + + switch_constraint_names :ci_build_needs, :fk_rails_3cf221d4ed_p, :temp_fk_rails_3cf221d4ed_p + end + + private + + def should_run? + can_execute_on?(:ci_build_needs, :ci_builds) + end + + def new_foreign_key_exists? + foreign_key_exists?(:ci_build_needs, :p_ci_builds, name: :fk_rails_3cf221d4ed_p) + end +end diff --git a/db/post_migrate/20230615083741_replace_old_fk_ci_builds_runner_session_to_builds.rb b/db/post_migrate/20230615083741_replace_old_fk_ci_builds_runner_session_to_builds.rb new file mode 100644 index 00000000000..56a790aef62 --- /dev/null +++ b/db/post_migrate/20230615083741_replace_old_fk_ci_builds_runner_session_to_builds.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +class ReplaceOldFkCiBuildsRunnerSessionToBuilds < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum + + disable_ddl_transaction! + + def up + return unless should_run? + return if new_foreign_key_exists? + + with_lock_retries do + remove_foreign_key_if_exists :ci_builds_runner_session, :ci_builds, + name: :fk_rails_70707857d3_p, reverse_lock_order: true + + rename_constraint :ci_builds_runner_session, :temp_fk_rails_70707857d3_p, :fk_rails_70707857d3_p + end + end + + def down + return unless should_run? + return unless new_foreign_key_exists? + + add_concurrent_foreign_key :ci_builds_runner_session, :ci_builds, + name: :temp_fk_rails_70707857d3_p, + column: [:partition_id, :build_id], + target_column: [:partition_id, :id], + on_update: :cascade, + on_delete: :cascade, + validate: true, + reverse_lock_order: true + + switch_constraint_names :ci_builds_runner_session, :fk_rails_70707857d3_p, :temp_fk_rails_70707857d3_p + end + + private + + def should_run? + can_execute_on?(:ci_builds_runner_session, :ci_builds) + end + + def new_foreign_key_exists? + foreign_key_exists?(:ci_builds_runner_session, :p_ci_builds, name: :fk_rails_70707857d3_p) + end +end diff --git a/db/post_migrate/20230615083744_replace_old_fk_ci_pending_builds_to_builds.rb b/db/post_migrate/20230615083744_replace_old_fk_ci_pending_builds_to_builds.rb new file mode 100644 index 00000000000..42095da09e2 --- /dev/null +++ b/db/post_migrate/20230615083744_replace_old_fk_ci_pending_builds_to_builds.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +class ReplaceOldFkCiPendingBuildsToBuilds < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum + + disable_ddl_transaction! + + def up + return unless should_run? + return if new_foreign_key_exists? + + with_lock_retries do + remove_foreign_key_if_exists :ci_pending_builds, :ci_builds, + name: :fk_rails_725a2644a3_p, reverse_lock_order: true + + rename_constraint :ci_pending_builds, :temp_fk_rails_725a2644a3_p, :fk_rails_725a2644a3_p + end + end + + def down + return unless should_run? + return unless new_foreign_key_exists? + + add_concurrent_foreign_key :ci_pending_builds, :ci_builds, + name: :temp_fk_rails_725a2644a3_p, + column: [:partition_id, :build_id], + target_column: [:partition_id, :id], + on_update: :cascade, + on_delete: :cascade, + validate: true, + reverse_lock_order: true + + switch_constraint_names :ci_pending_builds, :fk_rails_725a2644a3_p, :temp_fk_rails_725a2644a3_p + end + + private + + def should_run? + can_execute_on?(:ci_pending_builds, :ci_builds) + end + + def new_foreign_key_exists? + foreign_key_exists?(:ci_pending_builds, :p_ci_builds, name: :fk_rails_725a2644a3_p) + end +end diff --git a/db/post_migrate/20230615083748_replace_old_fk_ci_build_trace_metadata_to_builds.rb b/db/post_migrate/20230615083748_replace_old_fk_ci_build_trace_metadata_to_builds.rb new file mode 100644 index 00000000000..72d598ae0b9 --- /dev/null +++ b/db/post_migrate/20230615083748_replace_old_fk_ci_build_trace_metadata_to_builds.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +class ReplaceOldFkCiBuildTraceMetadataToBuilds < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum + + disable_ddl_transaction! + + def up + return unless should_run? + return if new_foreign_key_exists? + + with_lock_retries do + remove_foreign_key_if_exists :ci_build_trace_metadata, :ci_builds, + name: :fk_rails_aebc78111f_p, reverse_lock_order: true + + rename_constraint :ci_build_trace_metadata, :temp_fk_rails_aebc78111f_p, :fk_rails_aebc78111f_p + end + end + + def down + return unless should_run? + return unless new_foreign_key_exists? + + add_concurrent_foreign_key :ci_build_trace_metadata, :ci_builds, + name: :temp_fk_rails_aebc78111f_p, + column: [:partition_id, :build_id], + target_column: [:partition_id, :id], + on_update: :cascade, + on_delete: :cascade, + validate: true, + reverse_lock_order: true + + switch_constraint_names :ci_build_trace_metadata, :fk_rails_aebc78111f_p, :temp_fk_rails_aebc78111f_p + end + + private + + def should_run? + can_execute_on?(:ci_build_trace_metadata, :ci_builds) + end + + def new_foreign_key_exists? + foreign_key_exists?(:ci_build_trace_metadata, :p_ci_builds, name: :fk_rails_aebc78111f_p) + end +end diff --git a/db/post_migrate/20230615202125_prepare_index_issues_on_project_health_status_asc_work_item_type.rb b/db/post_migrate/20230615202125_prepare_index_issues_on_project_health_status_asc_work_item_type.rb new file mode 100644 index 00000000000..ac8b9582fc8 --- /dev/null +++ b/db/post_migrate/20230615202125_prepare_index_issues_on_project_health_status_asc_work_item_type.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class PrepareIndexIssuesOnProjectHealthStatusAscWorkItemType < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_issues_on_project_health_status_asc_work_item_type' + + def up + prepare_async_index :issues, + [:project_id, :health_status, :id, :state_id, :work_item_type_id], + order: { health_status: 'ASC NULLS LAST', id: :desc }, + name: INDEX_NAME + end + + def down + unprepare_async_index :issues, INDEX_NAME + end +end diff --git a/db/post_migrate/20230615202511_prepare_index_issues_on_project_health_status_desc_work_item_type.rb b/db/post_migrate/20230615202511_prepare_index_issues_on_project_health_status_desc_work_item_type.rb new file mode 100644 index 00000000000..1c8b6cdd3a3 --- /dev/null +++ b/db/post_migrate/20230615202511_prepare_index_issues_on_project_health_status_desc_work_item_type.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class PrepareIndexIssuesOnProjectHealthStatusDescWorkItemType < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_issues_on_project_health_status_desc_work_item_type' + + def up + prepare_async_index :issues, + [:project_id, :health_status, :id, :state_id, :work_item_type_id], + order: { health_status: 'DESC NULLS LAST', id: :desc }, + name: INDEX_NAME + end + + def down + unprepare_async_index :issues, INDEX_NAME + end +end diff --git a/db/schema_migrations/20230615083713 b/db/schema_migrations/20230615083713 new file mode 100644 index 00000000000..bba2480cbf8 --- /dev/null +++ b/db/schema_migrations/20230615083713 @@ -0,0 +1 @@ +a65e4718899a9339ef47da715f1fe48e20142b634bb95b0db70d2e4b6c5cc103
\ No newline at end of file diff --git a/db/schema_migrations/20230615083715 b/db/schema_migrations/20230615083715 new file mode 100644 index 00000000000..e4ad899ae83 --- /dev/null +++ b/db/schema_migrations/20230615083715 @@ -0,0 +1 @@ +e5ba43d180f8761c1892541ab4ca38c178bd3768f5ca0b9cfa977309306d600f
\ No newline at end of file diff --git a/db/schema_migrations/20230615083720 b/db/schema_migrations/20230615083720 new file mode 100644 index 00000000000..f8f60a3dce4 --- /dev/null +++ b/db/schema_migrations/20230615083720 @@ -0,0 +1 @@ +96ad4cbf0debff7b289fa59b4af6164cd06226972ba55fbe696ad0e4c73eea0e
\ No newline at end of file diff --git a/db/schema_migrations/20230615083725 b/db/schema_migrations/20230615083725 new file mode 100644 index 00000000000..6ac0680cf6a --- /dev/null +++ b/db/schema_migrations/20230615083725 @@ -0,0 +1 @@ +c9e40d4c7d14b0914d520a8b425a8805e25e43beaea9b9a21a76e94c77431f79
\ No newline at end of file diff --git a/db/schema_migrations/20230615083730 b/db/schema_migrations/20230615083730 new file mode 100644 index 00000000000..42e2d42e1f9 --- /dev/null +++ b/db/schema_migrations/20230615083730 @@ -0,0 +1 @@ +694a5369b0d8536402e0fe1091413bd20f978035fa0f2ba0487d5287ffc6fe19
\ No newline at end of file diff --git a/db/schema_migrations/20230615083734 b/db/schema_migrations/20230615083734 new file mode 100644 index 00000000000..98b8e15bb8d --- /dev/null +++ b/db/schema_migrations/20230615083734 @@ -0,0 +1 @@ +c871540f13d8d0ee7945ff1dd625ace59ec2b1f0907701ba7ff62d411bd51dac
\ No newline at end of file diff --git a/db/schema_migrations/20230615083738 b/db/schema_migrations/20230615083738 new file mode 100644 index 00000000000..e11c8271bf3 --- /dev/null +++ b/db/schema_migrations/20230615083738 @@ -0,0 +1 @@ +5eb86fcc023323c515964827c44052b5b6d8b6b216b3ccbde8b2e2033fd72180
\ No newline at end of file diff --git a/db/schema_migrations/20230615083741 b/db/schema_migrations/20230615083741 new file mode 100644 index 00000000000..d283365a057 --- /dev/null +++ b/db/schema_migrations/20230615083741 @@ -0,0 +1 @@ +86407b35a175581e639e9e7d537e5655a80cf998f7c46e17b011b4f0241ffd5c
\ No newline at end of file diff --git a/db/schema_migrations/20230615083744 b/db/schema_migrations/20230615083744 new file mode 100644 index 00000000000..6a09de1bf8a --- /dev/null +++ b/db/schema_migrations/20230615083744 @@ -0,0 +1 @@ +0bfa09f5e8290de7dc2931b1ef6f5259653619cb4a722a04dc58c3c98eb523e4
\ No newline at end of file diff --git a/db/schema_migrations/20230615083748 b/db/schema_migrations/20230615083748 new file mode 100644 index 00000000000..115ecab5e8a --- /dev/null +++ b/db/schema_migrations/20230615083748 @@ -0,0 +1 @@ +c18fe1c9744ebb939972f561f1de88afafedd0bba61b190d5fce4df25bd2d9f7
\ No newline at end of file diff --git a/db/schema_migrations/20230615202125 b/db/schema_migrations/20230615202125 new file mode 100644 index 00000000000..fc64742291d --- /dev/null +++ b/db/schema_migrations/20230615202125 @@ -0,0 +1 @@ +99ecaa37e4b47b15fafb593e9af6bcf37f393dd10ecfdbd11a196c4700ab9571
\ No newline at end of file diff --git a/db/schema_migrations/20230615202511 b/db/schema_migrations/20230615202511 new file mode 100644 index 00000000000..391fa51d1f9 --- /dev/null +++ b/db/schema_migrations/20230615202511 @@ -0,0 +1 @@ +eb2627c95cf579d4c8a0eaa239093b0b3badbf666c257425bcb5d5a47cbf7d87
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 7215a1114a8..6576dc0615d 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -35642,7 +35642,7 @@ ALTER TABLE ONLY requirements ADD CONSTRAINT fk_85044baef0 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; ALTER TABLE ONLY ci_build_pending_states - ADD CONSTRAINT fk_861cd17da3_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; + ADD CONSTRAINT fk_861cd17da3_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE ONLY geo_event_log ADD CONSTRAINT fk_86c84214ec FOREIGN KEY (repository_renamed_event_id) REFERENCES geo_repository_renamed_events(id) ON DELETE CASCADE; @@ -35666,7 +35666,7 @@ ALTER TABLE ONLY issues ADD CONSTRAINT fk_899c8f3231 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; ALTER TABLE ONLY ci_build_trace_chunks - ADD CONSTRAINT fk_89e29fa5ee_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; + ADD CONSTRAINT fk_89e29fa5ee_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE ONLY sbom_vulnerable_component_versions ADD CONSTRAINT fk_8a2a1197f9 FOREIGN KEY (sbom_component_version_id) REFERENCES sbom_component_versions(id) ON DELETE CASCADE; @@ -35735,7 +35735,7 @@ ALTER TABLE ONLY user_group_callouts ADD CONSTRAINT fk_9dc8b9d4b2 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; ALTER TABLE ONLY ci_unit_test_failures - ADD CONSTRAINT fk_9e0fc58930_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; + ADD CONSTRAINT fk_9e0fc58930_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE ONLY protected_environments ADD CONSTRAINT fk_9e112565b7 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -35894,7 +35894,7 @@ ALTER TABLE ONLY snippets ADD CONSTRAINT fk_be41fd4bb7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; ALTER TABLE ONLY ci_sources_pipelines - ADD CONSTRAINT fk_be5624bf37_p FOREIGN KEY (source_partition_id, source_job_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; + ADD CONSTRAINT fk_be5624bf37_p FOREIGN KEY (source_partition_id, source_job_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE ONLY packages_maven_metadata ADD CONSTRAINT fk_be88aed360 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; @@ -36053,7 +36053,7 @@ ALTER TABLE ONLY approval_project_rules ADD CONSTRAINT fk_e1372c912e FOREIGN KEY (scan_result_policy_id) REFERENCES scan_result_policies(id) ON DELETE CASCADE; ALTER TABLE ONLY ci_resources - ADD CONSTRAINT fk_e169a8e3d5_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE SET NULL; + ADD CONSTRAINT fk_e169a8e3d5_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE SET NULL; ALTER TABLE ONLY ci_sources_pipelines ADD CONSTRAINT fk_e1bad85861 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; @@ -36347,7 +36347,7 @@ ALTER TABLE ONLY users_security_dashboard_projects ADD CONSTRAINT fk_rails_150cd5682c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; ALTER TABLE ONLY ci_build_report_results - ADD CONSTRAINT fk_rails_16cb1ff064_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; + ADD CONSTRAINT fk_rails_16cb1ff064_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE ONLY catalog_resources ADD CONSTRAINT fk_rails_16f09e5c44 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -36605,7 +36605,7 @@ ALTER TABLE ONLY chat_teams ADD CONSTRAINT fk_rails_3b543909cb FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; ALTER TABLE ONLY ci_build_needs - ADD CONSTRAINT fk_rails_3cf221d4ed_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; + ADD CONSTRAINT fk_rails_3cf221d4ed_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE ONLY cluster_groups ADD CONSTRAINT fk_rails_3d28377556 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -36959,7 +36959,7 @@ ALTER TABLE ONLY analytics_dashboards_pointers ADD CONSTRAINT fk_rails_7027b7eaa9 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; ALTER TABLE ONLY ci_builds_runner_session - ADD CONSTRAINT fk_rails_70707857d3_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; + ADD CONSTRAINT fk_rails_70707857d3_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE ONLY list_user_preferences ADD CONSTRAINT fk_rails_70b2ef5ce2 FOREIGN KEY (list_id) REFERENCES lists(id) ON DELETE CASCADE; @@ -36968,7 +36968,7 @@ ALTER TABLE ONLY project_custom_attributes ADD CONSTRAINT fk_rails_719c3dccc5 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; ALTER TABLE ONLY ci_pending_builds - ADD CONSTRAINT fk_rails_725a2644a3_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; + ADD CONSTRAINT fk_rails_725a2644a3_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE security_findings ADD CONSTRAINT fk_rails_729b763a54 FOREIGN KEY (scanner_id) REFERENCES vulnerability_scanners(id) ON DELETE CASCADE; @@ -37370,7 +37370,7 @@ ALTER TABLE ONLY metrics_dashboard_annotations ADD CONSTRAINT fk_rails_aeb11a7643 FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE CASCADE; ALTER TABLE ONLY ci_build_trace_metadata - ADD CONSTRAINT fk_rails_aebc78111f_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; + ADD CONSTRAINT fk_rails_aebc78111f_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE ONLY bulk_import_trackers ADD CONSTRAINT fk_rails_aed566d3f3 FOREIGN KEY (bulk_import_entity_id) REFERENCES bulk_import_entities(id) ON DELETE CASCADE; @@ -37942,39 +37942,9 @@ ALTER TABLE issue_search_data ALTER TABLE product_analytics_events_experimental ADD CONSTRAINT product_analytics_events_experimental_project_id_fkey FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; -ALTER TABLE ONLY ci_build_pending_states - ADD CONSTRAINT temp_fk_861cd17da3_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; - -ALTER TABLE ONLY ci_build_trace_chunks - ADD CONSTRAINT temp_fk_89e29fa5ee_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; - -ALTER TABLE ONLY ci_unit_test_failures - ADD CONSTRAINT temp_fk_9e0fc58930_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; - -ALTER TABLE ONLY ci_sources_pipelines - ADD CONSTRAINT temp_fk_be5624bf37_p FOREIGN KEY (source_partition_id, source_job_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; - -ALTER TABLE ONLY ci_resources - ADD CONSTRAINT temp_fk_e169a8e3d5_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE SET NULL; - ALTER TABLE ONLY ci_builds_metadata ADD CONSTRAINT temp_fk_e20479742e_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID; -ALTER TABLE ONLY ci_build_report_results - ADD CONSTRAINT temp_fk_rails_16cb1ff064_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; - -ALTER TABLE ONLY ci_build_needs - ADD CONSTRAINT temp_fk_rails_3cf221d4ed_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; - -ALTER TABLE ONLY ci_builds_runner_session - ADD CONSTRAINT temp_fk_rails_70707857d3_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; - -ALTER TABLE ONLY ci_pending_builds - ADD CONSTRAINT temp_fk_rails_725a2644a3_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; - -ALTER TABLE ONLY ci_build_trace_metadata - ADD CONSTRAINT temp_fk_rails_aebc78111f_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; - ALTER TABLE ONLY ci_job_artifacts ADD CONSTRAINT temp_fk_rails_c5137cb2c1_p FOREIGN KEY (partition_id, job_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID; |