START TRANSACTION;

ALTER TABLE `exercise_tree`
	ADD COLUMN `internal_name` CHAR(50) NULL DEFAULT NULL AFTER `active`;
ALTER TABLE `exercise_tree`
	ADD INDEX `internal_name` (`internal_name`);

ALTER TABLE `training_plan`
	ADD COLUMN `internal_name` CHAR(50) NULL DEFAULT NULL AFTER `type`;
ALTER TABLE `training_plan`
	ADD COLUMN `free` TINYINT(1) NULL DEFAULT 0 AFTER `internal_name`;
ALTER TABLE `training_plan`
	ADD INDEX `internal_name` (`internal_name`);

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

COMMIT;
