Yes, the smallest integer type of DBMSes is usually a byte (TINYINT on MySQL). Converting to the integers 0 and 1 like this is fine, but from an architecture point this is likely the wrong place to do it. Can take a deeper look.