From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030303 Description of problem: boolean fields are currently stored in the db as char(1) columns. The expected value is either '0' or '1'. As such, the ddl generator should add check constraints to the ddl to ensure that '0' and '1' are the only possible values entered. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. open ddl/{oracle-se,postgres}/table-cat_categories-auto.sql 2. 3. Actual Results: create table cat_categories ( category_id INTEGER not null constraint cat_categori_catego_id_p_yeprq primary key, -- referential constraint for category_id deferred due to circular dependencies description VARCHAR(4000), name VARCHAR(200) not null, url VARCHAR(200), enabled_p CHAR(1) not null, abstract_p CHAR(1) not null, default_ancestors VARCHAR(3209) not null ); Expected Results: create table cat_categories ( category_id INTEGER not null constraint cat_categori_catego_id_p_yeprq primary key, -- referential constraint for category_id deferred due to circular dependencies description VARCHAR(4000), name VARCHAR(200) not null, url VARCHAR(200), enabled_p CHAR(1) not null constraint <constraint_name> check(enabled_p in ('0','1')), abstract_p CHAR(1) not null constraint <constraint_name> check(abstract_p in ('0','1')), default_ancestors VARCHAR(3209) not null ); Additional info:
I've confirmed that the check constraint is added correctly. However, could we add names for the constraints? This would make upgrade scripts easier.