2015-07-29 17:54:41 +03:00
|
|
|
class CreateParticipations < ActiveRecord::Migration
|
|
|
|
def change
|
|
|
|
create_table :participations do |t|
|
2015-08-10 20:47:32 +03:00
|
|
|
t.references :participant, index: true
|
2015-07-29 17:54:41 +03:00
|
|
|
t.references :event, index: true, foreign_key: true
|
|
|
|
t.boolean :approved, default: false
|
|
|
|
|
|
|
|
t.timestamps null: false
|
|
|
|
end
|
2015-08-10 20:47:32 +03:00
|
|
|
|
|
|
|
add_foreign_key :participations, :users, column: :participant_id
|
2015-07-29 17:54:41 +03:00
|
|
|
end
|
|
|
|
end
|