diff --git a/db/migrate/20150729135346_create_participations.rb b/db/migrate/20150729135346_create_participations.rb index e6ed3c2..848f62f 100644 --- a/db/migrate/20150729135346_create_participations.rb +++ b/db/migrate/20150729135346_create_participations.rb @@ -1,11 +1,13 @@ class CreateParticipations < ActiveRecord::Migration def change create_table :participations do |t| - t.references :participant, index: true, foreign_key: true + t.references :participant, index: true t.references :event, index: true, foreign_key: true t.boolean :approved, default: false t.timestamps null: false end + + add_foreign_key :participations, :users, column: :participant_id end end