diff --git a/db/migrate/20240415134942_add_imported_to_notes.rb b/db/migrate/20240415134942_add_imported_to_notes.rb new file mode 100644 index 0000000000000000000000000000000000000000..14cfad1f5cddb324597afc6121f23a657ae91371 --- /dev/null +++ b/db/migrate/20240415134942_add_imported_to_notes.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddImportedToNotes < Gitlab::Database::Migration[2.2] + milestone '17.0' + + def change + add_column :notes, :imported, :integer, default: 0, null: false, limit: 2 + end +end diff --git a/db/migrate/20240415135009_add_imported_to_merge_requests.rb b/db/migrate/20240415135009_add_imported_to_merge_requests.rb new file mode 100644 index 0000000000000000000000000000000000000000..4101eccb43d848088e5dadefd928a7fdceec5141 --- /dev/null +++ b/db/migrate/20240415135009_add_imported_to_merge_requests.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddImportedToMergeRequests < Gitlab::Database::Migration[2.2] + milestone '17.0' + + def change + add_column :merge_requests, :imported, :integer, default: 0, null: false, limit: 2 + end +end diff --git a/db/migrate/20240415135029_add_imported_to_issues.rb b/db/migrate/20240415135029_add_imported_to_issues.rb new file mode 100644 index 0000000000000000000000000000000000000000..28785862d7a2a8088ba466ad835e18208d11189f --- /dev/null +++ b/db/migrate/20240415135029_add_imported_to_issues.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddImportedToIssues < Gitlab::Database::Migration[2.2] + milestone '17.0' + + def change + add_column :issues, :imported, :integer, default: 0, null: false, limit: 2 + end +end diff --git a/db/migrate/20240415135048_add_imported_to_epics.rb b/db/migrate/20240415135048_add_imported_to_epics.rb new file mode 100644 index 0000000000000000000000000000000000000000..f9f0bce6bab4df43d18711235a1c13bb05e457db --- /dev/null +++ b/db/migrate/20240415135048_add_imported_to_epics.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddImportedToEpics < Gitlab::Database::Migration[2.2] + milestone '17.0' + + def change + add_column :epics, :imported, :integer, default: 0, null: false, limit: 2 + end +end diff --git a/db/migrate/20240415135110_add_imported_to_events.rb b/db/migrate/20240415135110_add_imported_to_events.rb new file mode 100644 index 0000000000000000000000000000000000000000..49bc5e912541d97c96ff3495b067b909e00363c4 --- /dev/null +++ b/db/migrate/20240415135110_add_imported_to_events.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddImportedToEvents < Gitlab::Database::Migration[2.2] + milestone '17.0' + + def change + add_column :events, :imported, :integer, default: 0, null: false, limit: 2 + end +end diff --git a/db/migrate/20240415135132_add_imported_to_snippets.rb b/db/migrate/20240415135132_add_imported_to_snippets.rb new file mode 100644 index 0000000000000000000000000000000000000000..2d1fdc71add3fa001c9dd18e15020ecd861ab6c1 --- /dev/null +++ b/db/migrate/20240415135132_add_imported_to_snippets.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddImportedToSnippets < Gitlab::Database::Migration[2.2] + milestone '17.0' + + def change + add_column :snippets, :imported, :integer, default: 0, null: false, limit: 2 + end +end diff --git a/db/migrate/20240415135156_add_imported_to_designs.rb b/db/migrate/20240415135156_add_imported_to_designs.rb new file mode 100644 index 0000000000000000000000000000000000000000..df5f2a11935403ad4a2731545445214c461d8e47 --- /dev/null +++ b/db/migrate/20240415135156_add_imported_to_designs.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddImportedToDesigns < Gitlab::Database::Migration[2.2] + milestone '17.0' + + def change + add_column :design_management_designs, :imported, :integer, default: 0, null: false, limit: 2 + end +end diff --git a/db/migrate/20240415135324_add_imported_to_resource_event_tables.rb b/db/migrate/20240415135324_add_imported_to_resource_event_tables.rb new file mode 100644 index 0000000000000000000000000000000000000000..6eee5d0fbd235a11f4332bec46c9b5ac291460c6 --- /dev/null +++ b/db/migrate/20240415135324_add_imported_to_resource_event_tables.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddImportedToResourceEventTables < Gitlab::Database::Migration[2.2] + milestone '17.0' + + def change + add_column :resource_state_events, :imported, :integer, default: 0, null: false, limit: 2 + add_column :resource_label_events, :imported, :integer, default: 0, null: false, limit: 2 + add_column :resource_milestone_events, :imported, :integer, default: 0, null: false, limit: 2 + end +end diff --git a/db/migrate/20240415164720_add_imported_to_temp_notes_backup.rb b/db/migrate/20240415164720_add_imported_to_temp_notes_backup.rb new file mode 100644 index 0000000000000000000000000000000000000000..73da8febbd7890e4c0b69aabc24ec17152db36bb --- /dev/null +++ b/db/migrate/20240415164720_add_imported_to_temp_notes_backup.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddImportedToTempNotesBackup < Gitlab::Database::Migration[2.2] + milestone '17.0' + + def change + add_column :temp_notes_backup, :imported, :integer, default: 0, null: false, limit: 2 + end +end diff --git a/db/schema_migrations/20240415134942 b/db/schema_migrations/20240415134942 new file mode 100644 index 0000000000000000000000000000000000000000..e7b543b74997b3a7e9b891948db57e3fbc289b21 --- /dev/null +++ b/db/schema_migrations/20240415134942 @@ -0,0 +1 @@ +d5e6e6528c8f58d82c666d81e18da6247886a23aa5722fb371cea23b0a614d48 \ No newline at end of file diff --git a/db/schema_migrations/20240415135009 b/db/schema_migrations/20240415135009 new file mode 100644 index 0000000000000000000000000000000000000000..4f98135f7d138ef2e292c72cbca545dbb319b08e --- /dev/null +++ b/db/schema_migrations/20240415135009 @@ -0,0 +1 @@ +d210368410e6d03c57199d1b4fe75652d49da8260a91a238a684e39349546a87 \ No newline at end of file diff --git a/db/schema_migrations/20240415135029 b/db/schema_migrations/20240415135029 new file mode 100644 index 0000000000000000000000000000000000000000..3647314d83a69097d06be5b8fa483b4e2937a7ce --- /dev/null +++ b/db/schema_migrations/20240415135029 @@ -0,0 +1 @@ +83b01048cf6d8dd770de7d085333516e84625535ebd238a91a8fd3919461717b \ No newline at end of file diff --git a/db/schema_migrations/20240415135048 b/db/schema_migrations/20240415135048 new file mode 100644 index 0000000000000000000000000000000000000000..c807412fd6ba5b38201628481ea646620cad39e6 --- /dev/null +++ b/db/schema_migrations/20240415135048 @@ -0,0 +1 @@ +da4fac700bb88854534542a03dc73ed495d39c7ee4cfecdb4721227e652a9dd6 \ No newline at end of file diff --git a/db/schema_migrations/20240415135110 b/db/schema_migrations/20240415135110 new file mode 100644 index 0000000000000000000000000000000000000000..546546f26c166eb1c103f25a21383844e819994a --- /dev/null +++ b/db/schema_migrations/20240415135110 @@ -0,0 +1 @@ +7af637894b463cce350af704f2bb7ad76160f2aaa56ce94177f75367a70eeee0 \ No newline at end of file diff --git a/db/schema_migrations/20240415135132 b/db/schema_migrations/20240415135132 new file mode 100644 index 0000000000000000000000000000000000000000..c0b9a8a69fde697c954faaa9a4b05c1d53a0f93a --- /dev/null +++ b/db/schema_migrations/20240415135132 @@ -0,0 +1 @@ +fd67478569eaea20f5e139f936cc6543027a3db5f4c15ae9aba927fd01d931e1 \ No newline at end of file diff --git a/db/schema_migrations/20240415135156 b/db/schema_migrations/20240415135156 new file mode 100644 index 0000000000000000000000000000000000000000..a92443e4e2fa5e7ec8c21ea1f170b4e58b0596d9 --- /dev/null +++ b/db/schema_migrations/20240415135156 @@ -0,0 +1 @@ +290a65b2b0cf3f82c94d29cd76e1f298b82766a0c7f0f25eaab517e028b7a023 \ No newline at end of file diff --git a/db/schema_migrations/20240415135324 b/db/schema_migrations/20240415135324 new file mode 100644 index 0000000000000000000000000000000000000000..1f7c8b5f6748df27089d7a896067a0d19f177ae4 --- /dev/null +++ b/db/schema_migrations/20240415135324 @@ -0,0 +1 @@ +95f6ecf12fee7db963b8e3e580b3cfc5ccf104fd0481af32604a9011ce33ad57 \ No newline at end of file diff --git a/db/schema_migrations/20240415164720 b/db/schema_migrations/20240415164720 new file mode 100644 index 0000000000000000000000000000000000000000..6e79d26f6828872b1c8df2c9639ac02a029c3d4c --- /dev/null +++ b/db/schema_migrations/20240415164720 @@ -0,0 +1 @@ +40d7a47f5eed49385ef83629c63b3103c450e382b3697510e39883056ec67712 \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 0269e419e31c2abd2712e9e46b8845f19a31fa6d..2ec2a1443ffecf356c3ba94c7a0f7c44b7024a30 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -8249,6 +8249,7 @@ CREATE TABLE design_management_designs ( cached_markdown_version integer, description text, description_html text, + imported smallint DEFAULT 0 NOT NULL, CONSTRAINT check_07155e2715 CHECK ((char_length((filename)::text) <= 255)), CONSTRAINT check_aaf9fa6ae5 CHECK ((char_length(description) <= 1000000)), CONSTRAINT check_cfb92df01a CHECK ((iid IS NOT NULL)) @@ -8739,6 +8740,7 @@ CREATE TABLE epics ( total_opened_issue_count integer DEFAULT 0 NOT NULL, total_closed_issue_count integer DEFAULT 0 NOT NULL, issue_id integer, + imported smallint DEFAULT 0 NOT NULL, CONSTRAINT check_ca608c40b3 CHECK ((char_length(color) <= 7)), CONSTRAINT check_fcfb4a93ff CHECK ((lock_version IS NOT NULL)) ); @@ -8834,6 +8836,7 @@ CREATE TABLE events ( fingerprint bytea, id bigint NOT NULL, target_id bigint, + imported smallint DEFAULT 0 NOT NULL, CONSTRAINT check_97e06e05ad CHECK ((octet_length(fingerprint) <= 128)) ); @@ -10429,6 +10432,7 @@ CREATE TABLE issues ( namespace_id bigint, start_date date, tmp_epic_id bigint, + imported smallint DEFAULT 0 NOT NULL, CONSTRAINT check_2addf801cd CHECK ((work_item_type_id IS NOT NULL)), CONSTRAINT check_c33362cd43 CHECK ((namespace_id IS NOT NULL)), CONSTRAINT check_fba63f706d CHECK ((lock_version IS NOT NULL)) @@ -11331,6 +11335,7 @@ CREATE TABLE merge_requests ( merged_commit_sha bytea, override_requested_changes boolean DEFAULT false NOT NULL, head_pipeline_id_convert_to_bigint bigint, + imported smallint DEFAULT 0 NOT NULL, CONSTRAINT check_970d272570 CHECK ((lock_version IS NOT NULL)) ); @@ -12018,7 +12023,8 @@ CREATE TABLE notes ( last_edited_at timestamp with time zone, internal boolean DEFAULT false NOT NULL, id bigint NOT NULL, - namespace_id bigint + namespace_id bigint, + imported smallint DEFAULT 0 NOT NULL ); CREATE SEQUENCE notes_id_seq @@ -15243,7 +15249,8 @@ CREATE TABLE resource_label_events ( created_at timestamp with time zone NOT NULL, cached_markdown_version integer, reference text, - reference_html text + reference_html text, + imported smallint DEFAULT 0 NOT NULL ); CREATE SEQUENCE resource_label_events_id_seq @@ -15282,7 +15289,8 @@ CREATE TABLE resource_milestone_events ( milestone_id bigint, action smallint NOT NULL, state smallint NOT NULL, - created_at timestamp with time zone NOT NULL + created_at timestamp with time zone NOT NULL, + imported smallint DEFAULT 0 NOT NULL ); CREATE SEQUENCE resource_milestone_events_id_seq @@ -15306,6 +15314,7 @@ CREATE TABLE resource_state_events ( close_after_error_tracking_resolve boolean DEFAULT false NOT NULL, close_auto_resolve_prometheus_alert boolean DEFAULT false NOT NULL, source_merge_request_id bigint, + imported smallint DEFAULT 0 NOT NULL, CONSTRAINT check_f0bcfaa3a2 CHECK ((char_length(source_commit) <= 40)), CONSTRAINT state_events_must_belong_to_issue_or_merge_request_or_epic CHECK ((((issue_id <> NULL::bigint) AND (merge_request_id IS NULL) AND (epic_id IS NULL)) OR ((issue_id IS NULL) AND (merge_request_id <> NULL::bigint) AND (epic_id IS NULL)) OR ((issue_id IS NULL) AND (merge_request_id IS NULL) AND (epic_id <> NULL::integer)))) ); @@ -16128,7 +16137,8 @@ CREATE TABLE snippets ( encrypted_secret_token character varying(255), encrypted_secret_token_iv character varying(255), secret boolean DEFAULT false NOT NULL, - repository_read_only boolean DEFAULT false NOT NULL + repository_read_only boolean DEFAULT false NOT NULL, + imported smallint DEFAULT 0 NOT NULL ); CREATE SEQUENCE snippets_id_seq @@ -16554,7 +16564,8 @@ CREATE TABLE temp_notes_backup ( last_edited_at timestamp with time zone, internal boolean NOT NULL, id bigint NOT NULL, - namespace_id bigint + namespace_id bigint, + imported smallint DEFAULT 0 NOT NULL ); CREATE TABLE term_agreements ( diff --git a/lib/gitlab/design_management/copy_design_collection_model_attributes.yml b/lib/gitlab/design_management/copy_design_collection_model_attributes.yml index fe1baeb7b67d2f5b313279d83fafac4063cc5818..bf2626c06a380b1a691584a0b61a74489c045da3 100644 --- a/lib/gitlab/design_management/copy_design_collection_model_attributes.yml +++ b/lib/gitlab/design_management/copy_design_collection_model_attributes.yml @@ -17,6 +17,7 @@ design_attributes: - filename - relative_position - description + - imported version_attributes: - author_id diff --git a/spec/lib/gitlab/import_export/safe_model_attributes.yml b/spec/lib/gitlab/import_export/safe_model_attributes.yml index 2547f4abda054d310f5d55907e62f88d7392cc00..608f18305477c207991bf4e7f898f678fe2590cb 100644 --- a/spec/lib/gitlab/import_export/safe_model_attributes.yml +++ b/spec/lib/gitlab/import_export/safe_model_attributes.yml @@ -34,6 +34,7 @@ Issue: - external_key - issue_type - email_message_id +- imported Event: - id - target_type @@ -44,6 +45,7 @@ Event: - action - author_id - fingerprint +- imported WikiPage::Meta: - id - title @@ -87,6 +89,7 @@ Note: - confidential - last_edited_at - internal +- imported Notes::NoteMetadata: - note_id - email_participant @@ -133,6 +136,7 @@ ProjectSnippet: - file_name - type - visibility_level +- imported Release: - id - name @@ -217,6 +221,7 @@ MergeRequest: - allow_maintainer_to_push - merge_ref_sha - draft +- imported MergeRequestDiff: - id - state @@ -996,6 +1001,7 @@ Epic: - total_closed_issue_weight - total_opened_issue_count - total_closed_issue_count + - imported EpicIssue: - id - relative_position diff --git a/spec/models/snippet_spec.rb b/spec/models/snippet_spec.rb index ff1c5959cb0d3573f8b129d040e91d92fdb7d83d..a226a877f55ee9184502db1992e41fb0d822e66f 100644 --- a/spec/models/snippet_spec.rb +++ b/spec/models/snippet_spec.rb @@ -856,7 +856,8 @@ def to_json(params = {}) 'url' => Gitlab::UrlBuilder.build(snippet), 'type' => 'PersonalSnippet', 'created_at' => be_like_time(snippet.created_at), - 'updated_at' => be_like_time(snippet.updated_at) + 'updated_at' => be_like_time(snippet.updated_at), + 'imported' => 0 ) end end