▲ | grey-area 6 days ago | ||||||||||||||||||||||||||||||||||||||||||||||
I’d see the booleans as a bad thing in almost all cases, instead of a boolean you can have a timestamp or an integer field (which can expand later). In the is_a case almost always a type or kind is better as you’ll rarely just have bears even if you only start with bears, just as you rarely have just two states for a status field (say on or off), often these expand in use to include things like suspended, deleted and asleep. So generally I’d avoid booleans as they tend to multiply and increase complexity partially when they cover mutually exclusive states like live, deleted and suspended. I have seen is_visible, is_deleted and is_suspended all on the same table (without a status) and the resulting code and queries are not pretty. I’d use an integer rather than a timestamp to replace them though. | |||||||||||||||||||||||||||||||||||||||||||||||
▲ | ZYbCRq22HbJ2y7 5 days ago | parent | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||
Yeah, I mean, an integer can definitely hold more data than a boolean. If your data was simple enough, you could have an integer hold the entire meaning of a table's row, if every client understood how it was interpreted. You could do bitwise manipulations, encodings, and so on. Sometimes it is nice to understand what the data means in the schema alone. You can do that with enums, etc.
These are more of the sort of things I don't see needing enums, timestamps, integers... | |||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||
▲ | 5 days ago | parent | prev [-] | ||||||||||||||||||||||||||||||||||||||||||||||
[deleted] |