[go: up one dir, main page]

Add detected_at column to vulnerability_occurrences table

What does this MR do and why?

This MR implements the database migration requested in issue #556251 (closed) to add the detected_at column to the vulnerability_occurrences table.

With the vulnerability_occurrences table acting as the primary record representing a vulnerability as it exists within a branch context, certain columns don't make sense in their place on the higher level vulnerabilities table and need to be moved down.

This migration adds:

  • detected_at timestamp with time zone DEFAULT now()

Database changes

  • Adds detected_at column to vulnerability_occurrences table
  • Uses timestamptz type with now() default
  • Follows GitLab migration patterns for large tables with disable_ddl_transaction! and with_lock_retries

How to set up and validate locally

  1. Run the migration: bundle exec rails db:migrate
  2. Verify the column exists: bundle exec rails db:console and check the table schema
  3. Test rollback: bundle exec rails db:rollback

MR acceptance checklist

  • Database migration follows GitLab patterns
  • Migration is reversible
  • Uses appropriate column type and default value
  • Includes proper rubocop disables for oversized table

Closes #556251 (closed)

Merge request reports

Loading