gitlab-org--gitlab-foss/db/migrate/20210714120600_add_detected_at_to_vulnerabilities.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
447 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class AddDetectedAtToVulnerabilities < ActiveRecord::Migration[6.1]
include Gitlab::Database::MigrationHelpers
def up
with_lock_retries do
add_column :vulnerabilities, :detected_at, :datetime_with_timezone
change_column_default :vulnerabilities, :detected_at, -> { 'NOW()' }
end
end
def down
with_lock_retries do
remove_column :vulnerabilities, :detected_at
end
end
end