title: Relational database structure for Texas Hold'em poker data
body: <p>I am planning a relational database to store poker game data (like what would be included in the hand histories). I would like help figuring out how to design the associations. It seems like there should be 4 models: Game, Hand, Player, and Action (single action of a given player, like raise, fold, call).  Let me lay out what I have:</p>
  
  <pre><code>class Game &lt; ActiveRecord::Base
    has_many :hands
    has_many :actions
    has_and_belongs_to_many :players
  end
  
  class Hand &lt; ActiveRecord::Base
    has_many :actions
    belongs_to :game
    has_and_belongs_to_many :players
  end
  
  class Action &lt; ActiveRecord::Base
    belongs_to :game
    belongs_to :hand
    belongs_to :player
  end
  
  class Player &lt; ActiveRecord::Base
    has_and_belongs_to_many :games
    has_and_belongs_to_many :hands
    has_many :actions
  end
  </code></pre>
  
  <p>Does this make sense?</p>