porkchopclub/porkchop

View on GitHub
db/migrate/20150617032511_create_season_matches.rb

Summary

Maintainability
A
25 mins
Test Coverage
class CreateSeasonMatches < ActiveRecord::Migration
  def change
    create_table :season_matches do |t|
      t.belongs_to :match, index: true
      t.belongs_to :season, index: true

      t.timestamps null: false
    end
    add_foreign_key :season_matches, :matches
    add_foreign_key :season_matches, :seasons
  end
end