 	BEGIN	
 		DECLARE fields_done BOOLEAN DEFAULT FALSE;
 		DECLARE fields_cur CURSOR FOR
-			SELECT `id`, `col_name`, `type_name`, `ref_type_id`,
+			SELECT `id`, `col_name`, `type_name`, `is_nullable`, `ref_type_id`,
 				`is_list`, `compare_options`
 			FROM `nz_admin_db`.`temp_type_fields`;
 		DECLARE CONTINUE HANDLER FOR NOT FOUND

				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 (


	DECLARE EXIT HANDLER FOR SQLEXCEPTION
	BEGIN
		RESIGNAL;
		SIGNAL SQLSTATE 'HY000'
			SET MESSAGE_TEXT = "Some fields can't be removed";
	END;
