CREATEVIEW NiceList ASSELECT*FROM Children
WHERE behavior >2000AND parent.income >40000;
CREATEVIEW NaughtyList ASSELECT*FROM Children
WHERE behavior <=2000;
He used to have an is_nice bool but consultants convinced Santa it isn’t future proof enough to capture the nuances of kids behaviour in today’s world, such as “nice but always is really smug about it”. But the consultants kept making PowerPoints instead of updating the backend, so now Santa also has added a new value to behaviour: “consultant-like”
Why are we using magic strings for behavior?
Feel free to fork my comment.
CREATE VIEW NiceList AS SELECT * FROM Children WHERE behavior > 2000 AND parent.income > 40000; CREATE VIEW NaughtyList AS SELECT * FROM Children WHERE behavior <= 2000;Does Santa accept PRs?
It’s an ENUM and other people have to read this fucking codebase too, Brian!
I’ve a DBA who would insist on this being in a dimension table and using a foreign key constraint instead of just a fucking string
I like your DBA!
Users probably don’t.
He used to have an is_nice bool but consultants convinced Santa it isn’t future proof enough to capture the nuances of kids behaviour in today’s world, such as “nice but always is really smug about it”. But the consultants kept making PowerPoints instead of updating the backend, so now Santa also has added a new value to behaviour: “consultant-like”