Implement Tournament-Team relation

This commit is contained in:
Thor77 2018-11-13 20:41:18 +01:00
parent 3043c9f0d7
commit 07eb561f77
No known key found for this signature in database
GPG Key ID: 5051E71B46AA669A
2 changed files with 3 additions and 0 deletions

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
class Team < ApplicationRecord
belongs_to :tournament
end

View File

@ -36,6 +36,8 @@ class CreateSchema < ActiveRecord::Migration[5.2]
t.integer :group_points_scored
t.integer :group_points_recieved
t.belongs_to :tournament, index: true, null: false, foreign_key: { on_delete: :cascade }
t.timestamps
end