1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/db/migrate/20191002170727_fix_relationships_index_on_from_date.rb

17 lines
424 B
Ruby

# frozen_string_literal: true
class FixRelationshipsIndexOnFromDate < ActiveRecord::Migration[6.0]
def change
reversible do |dir|
dir.up do
remove_index :relationships, %i[person_id from_date]
end
dir.down do
add_index :relationships, %i[person_id from_date], unique: true
end
end
add_index :relationships, %i[person_id org_unit_id from_date], unique: true
end
end