START TRANSACTION;

CREATE TABLE `evaluation` (
	`evaluation_id` INT(11) NOT NULL AUTO_INCREMENT,
	`exercise_type_id` INT(11) NOT NULL,
	`name` CHAR(100) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
	`unit` CHAR(50) NULL DEFAULT NULL COMMENT 'repeats, second, etc' COLLATE 'utf8_hungarian_ci',
	PRIMARY KEY (`evaluation_id`) USING BTREE
)
COLLATE='utf8_hungarian_ci'
ENGINE=InnoDB
;

CREATE TABLE `evaluation_attribute` (
	`evaluation_attr_id` INT(11) NOT NULL AUTO_INCREMENT,
	`evaluation_id` INT(11) NOT NULL,
	`name` CHAR(50) NOT NULL DEFAULT '' COLLATE 'utf8_hungarian_ci',
	`age_min` INT(3) NOT NULL DEFAULT '0',
	`age_max` INT(3) NOT NULL DEFAULT '0',
	`value_min` DOUBLE NOT NULL DEFAULT '0',
	`value_max` DOUBLE NOT NULL DEFAULT '0',
	`sex` ENUM('m','w') NOT NULL DEFAULT 'm' COLLATE 'utf8_hungarian_ci',
	`evaluation_text` CHAR(50) NOT NULL COLLATE 'utf8_hungarian_ci',
	`suggestion` TEXT NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
	PRIMARY KEY (`evaluation_attr_id`) USING BTREE,
	INDEX `evalutation_id` (`evaluation_id`) USING BTREE
)
COLLATE='utf8_hungarian_ci'
ENGINE=InnoDB
;


UPDATE configuration set config_value = "1.0.29", date_change=CURRENT_DATE WHERE config_key = "db_version";

COMMIT;

