CREATE TABLE `property` (
	`property_id` INT(11) NOT NULL AUTO_INCREMENT,
	`property_name` CHAR(50) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
	`property_unit` CHAR(50) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
	PRIMARY KEY (`property_id`) USING BTREE
)
COLLATE='utf8_hungarian_ci'
ENGINE=InnoDB
;


INSERT INTO `property` (`property_id`, `property_name`, `property_unit`) VALUES (1, 'Weight', 'kg');
INSERT INTO `property` (`property_id`, `property_name`, `property_unit`) VALUES (2, 'Height', 'cm');
INSERT INTO `property` (`property_id`, `property_name`, `property_unit`) VALUES (3, 'Chest', 'cm');
INSERT INTO `property` (`property_id`, `property_name`, `property_unit`) VALUES (4, 'Biceps', 'cm');


CREATE TABLE `property_translation` (
	`translation_id` INT(13) NOT NULL AUTO_INCREMENT,
	`language_code` CHAR(2) NOT NULL DEFAULT 'en' COLLATE 'utf8mb4_general_ci',
	`property_id` INT(13) NOT NULL DEFAULT '0',
	`property_name` CHAR(50) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	PRIMARY KEY (`translation_id`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
;

CREATE TABLE `customer_property` (
	`customer_property_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
	`customer_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
	`property_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
	`property_value` DOUBLE UNSIGNED NOT NULL DEFAULT '0',
	`date_add` DATETIME NULL DEFAULT NULL,
	PRIMARY KEY (`customer_property_id`) USING BTREE
)
COLLATE='utf8_hungarian_ci'
ENGINE=InnoDB
;

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