Skip to content
Snippets Groups Projects
Unverified Commit b6b134ac authored by Alper Akgun's avatar Alper Akgun Committed by GitLab
Browse files

Merge branch '463854-import-sharding-bulk_import_exports' into 'master'

Create multi not null constraint for exports

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/168411



Merged-by: default avatarAlper Akgun <aakgun@gitlab.com>
Approved-by: default avatarAlper Akgun <aakgun@gitlab.com>
Reviewed-by: default avatarAlper Akgun <aakgun@gitlab.com>
Reviewed-by: default avatarBrian Williams <bwilliams@gitlab.com>
Co-authored-by: Keeyan Nejad's avatarKeeyan Nejad <knejad@gitlab.com>
parents 7e165b02 7b6dc073
No related branches found
No related tags found
No related merge requests found
# frozen_string_literal: true
class AddMultiNotNullConstraintToBulkImportExports < Gitlab::Database::Migration[2.2]
milestone '17.6'
disable_ddl_transaction!
def up
add_multi_column_not_null_constraint(:bulk_import_exports, :group_id, :project_id)
end
def down
remove_multi_column_not_null_constraint(:bulk_import_exports, :group_id, :project_id)
end
end
6560d591cabfeda2a813ef521492af968e282c7d329b8cd9769ac9607fa32c4b
\ No newline at end of file
Loading
Loading
@@ -8031,7 +8031,8 @@ CREATE TABLE bulk_import_exports (
user_id bigint,
CONSTRAINT check_24cb010672 CHECK ((char_length(relation) <= 255)),
CONSTRAINT check_8f0f357334 CHECK ((char_length(error) <= 255)),
CONSTRAINT check_9ee6d14d33 CHECK ((char_length(jid) <= 255))
CONSTRAINT check_9ee6d14d33 CHECK ((char_length(jid) <= 255)),
CONSTRAINT check_e84b7c0730 CHECK ((num_nonnulls(group_id, project_id) = 1))
);
 
CREATE SEQUENCE bulk_import_exports_id_seq
Loading
Loading
@@ -2,7 +2,7 @@
 
FactoryBot.define do
factory :bulk_import_export, class: 'BulkImports::Export', traits: %i[started] do
group
group { association(:group) if project.nil? }
relation { 'labels' }
 
trait :started do
Loading
Loading
Loading
Loading
@@ -27,7 +27,6 @@
'analytics_devops_adoption_segments.namespace_id',
*['badges.project_id', 'badges.group_id'],
*['boards.project_id', 'boards.group_id'],
*['bulk_import_exports.project_id', 'bulk_import_exports.group_id'],
'ci_pipeline_schedules.project_id',
'ci_sources_pipelines.project_id',
'ci_triggers.project_id',
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment