18 lines
733 B
Ruby
18 lines
733 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ChangeProjectIdIndexToBeUniqueOnVulnerabilityStatisticsTable < ActiveRecord::Migration[6.0]
|
|
DOWNTIME = false
|
|
|
|
INDEX_NAME = 'index_vulnerability_statistics_on_unique_project_id'
|
|
|
|
def up
|
|
remove_index :vulnerability_statistics, :project_id # rubocop:disable Migration/RemoveIndex (table is empty)
|
|
add_index :vulnerability_statistics, :project_id, name: INDEX_NAME, unique: true # rubocop:disable Migration/AddIndex (table is empty)
|
|
end
|
|
|
|
def down
|
|
remove_index :vulnerability_statistics, name: INDEX_NAME # rubocop:disable Migration/RemoveIndex (table is empty)
|
|
add_index :vulnerability_statistics, :project_id # rubocop:disable Migration/AddIndex (table is empty)
|
|
end
|
|
end
|