 					SET field_type = CONCAT(field_type, ' COLLATE `utf8_general_ci`');
 				END IF;
 			ELSE	-- not string
-				IF (RIGHT(field_type, 1) = '?') THEN
-					SET field_type =
-						SUBSTRING(field_type FROM 1 FOR CHAR_LENGTH(field_type)-1);
-				ELSE
+				IF (NOT cf_is_nullable) THEN
 					SET field_type = CONCAT(field_type, ' NOT NULL');
 				END IF;
 			END IF;

			CHECK(`col_name` != ''),
		`type_name` VARCHAR(64) NOT NULL
			CHECK(`type_name` != ''),
		`ref_type_id` INT DEFAULT NULL,
		`is_list` BOOLEAN NOT NULL DEFAULT FALSE,
		`compare_options` ENUM (

				CHECK(`col_name` != ''),
			`type_name` VARCHAR(64) NOT NULL
				CHECK(`type_name` != ''),
			`is_nullable` BOOLEAN NOT NULL DEFAULT FALSE,
			`ref_type_id` INT DEFAULT NULL,
			`is_list` BOOLEAN NOT NULL DEFAULT FALSE,
			`compare_options` ENUM (
