Sprankelprachtig aan/afmeldsysteem

20161231185937_enforce_many_to_many_uniqueness.rb 319B

12345678910
  1. class EnforceManyToManyUniqueness < ActiveRecord::Migration[5.0]
  2. def change
  3. add_index :participants, [:person_id, :activity_id], unique: true
  4. add_index :members, [:person_id, :group_id], unique: true
  5. remove_index :users, [:person_id]
  6. add_index :users, [:person_id], unique: true
  7. end
  8. end