START TRANSACTION;

CREATE TABLE `training_plan_day` (
	`day_id` INT(11) NOT NULL AUTO_INCREMENT,
	`name` CHAR(50) NOT NULL COLLATE 'utf8_hungarian_ci',
	PRIMARY KEY (`day_id`) USING BTREE
)
COLLATE='utf8_hungarian_ci'
ENGINE=InnoDB
;

CREATE TABLE `training_plan_day_translation` (
	`translation_id` INT(11) NOT NULL AUTO_INCREMENT,
	`day_id` INT(11) NOT NULL DEFAULT '0',
	`name_translation` CHAR(50) NOT NULL DEFAULT '0' COLLATE 'utf8_hungarian_ci',
	`language_code` CHAR(2) NULL DEFAULT 'en' COLLATE 'utf8_hungarian_ci',
	PRIMARY KEY (`translation_id`) USING BTREE,
	INDEX `day_id` (`day_id`) USING BTREE
)
COLLATE='utf8_hungarian_ci'
ENGINE=InnoDB
;

ALTER TABLE `training_plan_detail`
	ADD COLUMN `day_id` INT NULL DEFAULT NULL AFTER `day`;

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

COMMIT;
