Comment on A Bad Privacy BugComments−biot14yThe schema should really be: private bit not null default 0 If you use something like tinyint and have a range of values that are acceptable, bake this into the database with a check constraint: myfield tinyint not null default 0 check (myfield between 0 and 3) Regardless of how comprehensive your unit tests are, you should prevent as much bad data as you can at the DB layer.
Comments
The schema should really be:
If you use something like tinyint and have a range of values that are acceptable, bake this into the database with a check constraint: Regardless of how comprehensive your unit tests are, you should prevent as much bad data as you can at the DB layer.