4 ms·
Couldn't you have designed your schema to have a playerProperties table with a playerId column, a key column and a value column? That'd be forever extensible a
by 72deluxe 10y ago
Couldn't you have designed your schema to have a playerProperties table with a playerId column, a key column and a value column?
That'd be forever extensible and if you made the primary key a combination of playerId and key, you'd offload duplicate handling to the database.
Seems simple to me.
- combatentropy 10y agoThat's called EAV (Entity Attribute Value, https://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model https://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80...). I have done it before, once. While some folks will tell you it's just wrong, like NoSQL I think it's sometimes the best fit, even for the entire life of the app. For 99% of things, though, I use SQL tables, normalized to the Third Normal Form, foreign keys, the whole shebang.