diff --git a/db/migrate/20251001133644_add_detected_at_to_vulnerability_occurrences.rb b/db/migrate/20251001133644_add_detected_at_to_vulnerability_occurrences.rb new file mode 100644 index 0000000000000000000000000000000000000000..5709bde047ff6f62ac657f23ff78b14274d709fa --- /dev/null +++ b/db/migrate/20251001133644_add_detected_at_to_vulnerability_occurrences.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class AddDetectedAtToVulnerabilityOccurrences < Gitlab::Database::Migration[2.3] + milestone '18.6' + + disable_ddl_transaction! + + def up + # rubocop:disable Migration/PreventAddingColumns -- The oversized nature of this table will be addressed through planned partitioning + with_lock_retries do + add_column :vulnerability_occurrences, :detected_at, :timestamptz, if_not_exists: true + end + # rubocop:enable Migration/PreventAddingColumns + end + + def down + with_lock_retries do + remove_column :vulnerability_occurrences, :detected_at, if_exists: true + end + end +end diff --git a/db/schema_migrations/20251001133644 b/db/schema_migrations/20251001133644 new file mode 100644 index 0000000000000000000000000000000000000000..1219ce578b07b08b16d4ddeb982a317f9136d515 --- /dev/null +++ b/db/schema_migrations/20251001133644 @@ -0,0 +1 @@ +55004e8a0c4820c7fb30966331ea2af35c900e150421d67dfbd04641ce63bcf7 \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 022d5f53aef66899b67b930e5e126f81745e0b74..055b26038ea39ac733e41bf245a5d1c5bbea8f3c 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -28394,6 +28394,7 @@ CREATE TABLE vulnerability_occurrences ( initial_pipeline_id bigint, latest_pipeline_id bigint, security_project_tracked_context_id bigint, + detected_at timestamp with time zone, CONSTRAINT check_4a3a60f2ba CHECK ((char_length(solution) <= 7000)), CONSTRAINT check_ade261da6b CHECK ((char_length(description) <= 15000)), CONSTRAINT check_f602da68dd CHECK ((char_length(cve) <= 48400))