diff --git a/db/migrate/20251020103708_add_solution_to_vulnerabilities.rb b/db/migrate/20251020103708_add_solution_to_vulnerabilities.rb new file mode 100644 index 0000000000000000000000000000000000000000..6a897c2da33af3a08181a34de1e490efe7361a77 --- /dev/null +++ b/db/migrate/20251020103708_add_solution_to_vulnerabilities.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class AddSolutionToVulnerabilities < Gitlab::Database::Migration[2.3] + milestone '18.6' + + disable_ddl_transaction! + + def up + with_lock_retries do + add_column :vulnerabilities, :solution, :text, if_not_exists: true + end + + add_text_limit :vulnerabilities, :solution, 7000, validate: false + end + + def down + with_lock_retries do + remove_column :vulnerabilities, :solution, if_exists: true + end + end +end diff --git a/db/schema_migrations/20251020103708 b/db/schema_migrations/20251020103708 new file mode 100644 index 0000000000000000000000000000000000000000..84150067d6debaa936d5f3c976b9674d644be27b --- /dev/null +++ b/db/schema_migrations/20251020103708 @@ -0,0 +1 @@ +0a4f16950aaccc23304392cb1cae9ecef9d744121e486747d827a2129a4b73c2 \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 387820a3fa389bc97723e9f94a35546d24e5fac9..9b1d07742e02999162c55836c60b2d7dd628202a 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -28042,6 +28042,7 @@ CREATE TABLE vulnerabilities ( cvss jsonb DEFAULT '[]'::jsonb, auto_resolved boolean DEFAULT false NOT NULL, uuid uuid, + solution text, CONSTRAINT check_4d8a873f1f CHECK ((finding_id IS NOT NULL)) ); @@ -33259,6 +33260,9 @@ ALTER TABLE work_item_custom_statuses ALTER TABLE packages_packages ADD CONSTRAINT check_d6301aedeb CHECK ((char_length(status_message) <= 255)) NOT VALID; +ALTER TABLE vulnerabilities + ADD CONSTRAINT check_d7634b42b6 CHECK ((char_length(solution) <= 7000)) NOT VALID; + ALTER TABLE commit_user_mentions ADD CONSTRAINT check_ddd6f289f4 CHECK ((namespace_id IS NOT NULL)) NOT VALID;