russellcain / gockey

go fantasy project
0 stars 0 forks source link

database restructure? #7

Open russellcain opened 3 months ago

russellcain commented 3 months ago

I feel like im straddling a properly flat struct, but need to lean into it.

I think I want to go back to reading some different db design ideas; the flatness feels silly when the data is this straightforward of a relationship, but i guess it is okay. I'd prefer this division of data over updating multiple tables when something is added or deleted.

russellcain commented 3 months ago

Is there anything to be said for the idea of the team_id being a concatenation of a new int and the league_id? or the league id followed by a random string/uuid? then we can enforce uniqueness in the teams table and have that relationship embedded? it's a given that a team will never get "shifted" to another league, so this coupling seems like a fair dependency. But this is rife with its own set of muddling issues. I think a separate flat table is the way to go. I just don't like and believe it fully yet.