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

18 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