2 ms·
The 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
by biot 14y ago
The 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.