Is it bad to use enum('y','n') instead of a boolean field in a MySQL table? -
so few years ago saw db schema of system developed 3rd party , noticed used enum('y','n') instead of boolean (tinyint) field. don't know why loved much, found made things easier read (totally subjective know) adopted , started using ever since then. suppose swap "true" , "false" but, can say, liked it.
now being said, there setbacks doing things way -- aside maybe annoying programmer who'd come in late in game?
yes, bad. lose intuitive boolean logic (select * user not banned becomes select * user banned = 'n'), , receive strings instead of booleans on application side, boolean conditions there become cumbersome well. other people work schema bitten seeing flag-like column names , attempting use boolean logic on them.
Comments
Post a Comment