Implement Tournament-Team relation
This commit is contained in:
parent
3043c9f0d7
commit
07eb561f77
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Team < ApplicationRecord
|
class Team < ApplicationRecord
|
||||||
|
belongs_to :tournament
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,8 @@ class CreateSchema < ActiveRecord::Migration[5.2]
|
||||||
t.integer :group_points_scored
|
t.integer :group_points_scored
|
||||||
t.integer :group_points_recieved
|
t.integer :group_points_recieved
|
||||||
|
|
||||||
|
t.belongs_to :tournament, index: true, null: false, foreign_key: { on_delete: :cascade }
|
||||||
|
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue