J
@gotaq said:Is that necessarily a problem? Obviously, you don't want a game to be played, or have a score, if there are less than two teams, but in a scenario (e.g. playoffs) where a game is scheduled but the participants have yet to be determined, it could make sense.How do you determine where to draw the line regarding which business rules live in program logic rather than database constraints? Agreed -- it's really that when the results are returned and aggregated, a game must have two teams involved in order for it to be included in the standings and the results and so on. it's a data validation thing that has to happen, rather than a constraint. The logic still all lives in the database, of course, there is no reason to put it anywhere else, it is just applied when querying for the standings and results and so on. An "IncompleteGame" view or stored procedure would help to validate this as well.