This looks wrong to me for databases where booleans are not sotred as integers (Postgres for instance)