START TRANSACTION;

ALTER TABLE `training_plan`
	ADD COLUMN `tree_id` INT NULL DEFAULT NULL AFTER `training_plan_id`;

CREATE TABLE `split_tests` (
	`test_id` INT(11) NOT NULL AUTO_INCREMENT,
	`name` CHAR(50) NOT NULL COLLATE 'utf8_hungarian_ci',
	`remote_config_key` CHAR(50) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
	`remote_config_value` CHAR(50) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
	`test_value` TEXT NOT NULL COLLATE 'utf8_hungarian_ci',
	`active` TINYINT(1) NOT NULL DEFAULT '0',
	`valid_to` DATETIME NULL DEFAULT NULL,
	PRIMARY KEY (`test_id`) USING BTREE
)
COLLATE='utf8_hungarian_ci'
ENGINE=InnoDB
;


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

COMMIT;
