Fix foreign key constraint for Participations
This commit is contained in:
parent
1c876bfeb7
commit
a27fd44ad0
|
@ -1,11 +1,13 @@
|
||||||
class CreateParticipations < ActiveRecord::Migration
|
class CreateParticipations < ActiveRecord::Migration
|
||||||
def change
|
def change
|
||||||
create_table :participations do |t|
|
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.references :event, index: true, foreign_key: true
|
||||||
t.boolean :approved, default: false
|
t.boolean :approved, default: false
|
||||||
|
|
||||||
t.timestamps null: false
|
t.timestamps null: false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
add_foreign_key :participations, :users, column: :participant_id
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue