debian-mirror-gitlab/db/migrate/20210714120600_add_detected_at_to_vulnerabilities.rb

19 lines
447 B
Ruby
Raw Normal View History

2021-09-30 23:02:18 +05:30
# 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