-- --------------------------------------------------------
-- Host:                         127.0.0.1
-- Szerver verzió:               10.4.11-MariaDB - mariadb.org binary distribution
-- Szerver OS:                   Win64
-- HeidiSQL Verzió:              11.0.0.5919
-- --------------------------------------------------------

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;

use aitrainer;

CREATE TABLE `configuration` (
	`configuration_id` INT(11) NOT NULL AUTO_INCREMENT,
	`config_key` CHAR(50) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
	`config_value` CHAR(50) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
	`date_add` DATETIME NULL DEFAULT NULL,
	`date_change` DATETIME NULL DEFAULT NULL,
	PRIMARY KEY (`configuration_id`) USING BTREE
)
COLLATE='utf8_hungarian_ci'
ENGINE=InnoDB
AUTO_INCREMENT=2
;

INSERT INTO `configuration` (`configuration_id`, `config_key`, `config_value`, `date_add`, `date_change`) VALUES (1, 'db_version', '1.0.5', '2020-05-30 07:00:00', '2020-08-01 17:18:54');


-- Struktúra mentése tábla aitrainer. customer
CREATE TABLE IF NOT EXISTS `customer` (
  `customer_id` int(11) NOT NULL AUTO_INCREMENT,
  `name` char(100) COLLATE utf8_hungarian_ci NOT NULL,
  `firstname` char(100) COLLATE utf8_hungarian_ci NOT NULL,
  `email` char(100) COLLATE utf8_hungarian_ci DEFAULT NULL,
  `password` char(100) COLLATE utf8_hungarian_ci DEFAULT NULL,
  `sex` enum('m','w') COLLATE utf8_hungarian_ci DEFAULT 'm',
  `age` tinyint(4) DEFAULT NULL,
  `active` enum('Y','N','D','S') COLLATE utf8_hungarian_ci DEFAULT 'N',
  `date_add` datetime DEFAULT NULL,
  `date_change` datetime DEFAULT NULL,
  `data_policy_allowed` tinyint(4) DEFAULT 1,
  `admin` tinyint(4) DEFAULT 0,
  `trainer` tinyint(4) DEFAULT 0,
  `trainer_id` INT(11) NULL DEFAULT '0',
  `birth_year` int(4) DEFAULT 0,
    `weight` INT(3) NULL DEFAULT '0',
	`goal` CHAR(20) NULL DEFAULT '' COLLATE 'utf8_hungarian_ci',
	`fitness_level` ENUM('beginner','intermediate','advanced','professional') NOT NULL DEFAULT 'beginner' COLLATE 'utf8_hungarian_ci',
	`body_type` ENUM('ectomorph','mesomorph','endomorph') NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
	`firebase_uid` CHAR(50) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
  PRIMARY KEY (`customer_id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;

-- Tábla adatainak mentése aitrainer.customer: ~13 rows (hozzávetőleg)
/*!40000 ALTER TABLE `customer` DISABLE KEYS */;
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `trainer`, `trainer_id`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`, `firebase_uid`) VALUES (1, 'Átlag 13 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 137, 0, 0, '', 'beginner', NULL, NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `trainer`, `trainer_id`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`, `firebase_uid`) VALUES (2, 'Átlag 14 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `trainer`, `trainer_id`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`, `firebase_uid`) VALUES (3, 'Átlag 15 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `trainer`, `trainer_id`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`, `firebase_uid`) VALUES (4, 'Átlag 15 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 137, 0, 0, '', 'beginner', NULL, NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `trainer`, `trainer_id`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`, `firebase_uid`) VALUES (5, 'Átlag 16 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `trainer`, `trainer_id`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`, `firebase_uid`) VALUES (6, 'Átlag 17 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `trainer`, `trainer_id`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`, `firebase_uid`) VALUES (7, 'Átlag 18 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `trainer`, `trainer_id`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`, `firebase_uid`) VALUES (8, 'Átlag 13 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `trainer`, `trainer_id`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`, `firebase_uid`) VALUES (9, 'Átlag 14 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `trainer`, `trainer_id`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`, `firebase_uid`) VALUES (10, 'Átlag 15 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `trainer`, `trainer_id`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`, `firebase_uid`) VALUES (11, 'Átlag 16 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `trainer`, `trainer_id`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`, `firebase_uid`) VALUES (12, 'Átlag 17 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `trainer`, `trainer_id`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`, `firebase_uid`) VALUES (13, 'Átlag 18 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `trainer`, `trainer_id`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`, `firebase_uid`) VALUES (54, 'Dummy User', '', 'bosi', '$2a$10$thOc8jS750c7xe9U9Qq3GuSPs/H0Pt2Ads05yzUlyzQBIj.Rk9QCy', 'm', 0, 'N', NULL, NULL, 1, 1, 0, 0, 0, 0, '', 'beginner', NULL, NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `trainer`, `trainer_id`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`, `firebase_uid`) VALUES (90, 'Bossi', 'Tib', 'sw@andio.biz', '123456789', 'm', 0, 'Y', NULL, NULL, 1, 1, 0, 137, 1972, 79, NULL, 'advanced', 'endomorph', NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `trainer`, `trainer_id`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`, `firebase_uid`) VALUES (103, 'Bos', 'Kakadu', 'sw2@andio.biz', 'blabal', 'm', 0, 'N', NULL, NULL, 1, 0, 0, 0, 1972, 79, NULL, 'intermediate', NULL, "3FirebaseU1d");
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `trainer`, `trainer_id`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`, `firebase_uid`) VALUES (137, 'Robert', '', NULL, NULL, 'm', NULL, 'N', NULL, NULL, 1, 0, 1, 0, 0, 0, '', 'beginner', NULL, NULL);

/*!40000 ALTER TABLE `customer` ENABLE KEYS */;

-- Struktúra mentése tábla aitrainer. customer_information
CREATE TABLE IF NOT EXISTS `customer_information` (
  `customer_information_id` int(11) NOT NULL AUTO_INCREMENT,
  `title` char(50) COLLATE utf8_hungarian_ci DEFAULT '',
  `description` mediumtext COLLATE utf8_hungarian_ci DEFAULT NULL,
  `date_add` datetime DEFAULT NULL,
  `display_begin` datetime DEFAULT NULL,
  `display_end` datetime DEFAULT NULL,
  PRIMARY KEY (`customer_information_id`) USING BTREE,
  KEY `title` (`title`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;

-- Tábla adatainak mentése aitrainer.customer_information: ~0 rows (hozzávetőleg)
/*!40000 ALTER TABLE `customer_information` DISABLE KEYS */;
/*!40000 ALTER TABLE `customer_information` ENABLE KEYS */;

INSERT INTO `customer_information` (`customer_information_id`, `title`, `description`, `date_add`, `display_begin`, `display_end`) VALUES (1, 'Fekvőtámasz világcsúcs', 'Világcsúcs fekvőtámasz: KJ Joseph 1 perc alatt 82 szabályos fekvőtámaszt végzett', '2020-06-01 08:00:00', '2020-06-01 08:00:00', '2023-07-01 08:00:00');
INSERT INTO `customer_information` (`customer_information_id`, `title`, `description`, `date_add`, `display_begin`, `display_end`) VALUES (2, 'Húzódszkodás csúcs', '24 órás csúcstartója Joonas Mäkipelto 5050 gyakorlattal', '2020-06-01 08:00:00', '2020-06-01 08:00:00', '2023-07-01 08:00:00');
INSERT INTO `customer_information` (`customer_information_id`, `title`, `description`, `date_add`, `display_begin`, `display_end`) VALUES (3, 'Fekvenyomás', '2015-ben a fekvenyomó világbajnokságot Smulter Fredrik finn súlyemelő 401 Kg-al nyerte', '2020-06-01 08:00:00', '2020-05-01 00:00:00', '2020-06-01 08:00:01');


-- Struktúra mentése tábla aitrainer. exercises
CREATE TABLE IF NOT EXISTS `exercises` (
  `exercise_id` int(11) NOT NULL AUTO_INCREMENT,
  `exercise_type_id` int(11) NOT NULL,
  `customer_id` int(11) NOT NULL,
  `date_add` datetime NOT NULL,
  `quantity` float DEFAULT NULL,
  `unit` enum('kg','meter','repeat','minute') COLLATE utf8_hungarian_ci DEFAULT 'repeat',
  `unit_quantity` float DEFAULT NULL,
  `rest_time` int(11) DEFAULT NULL COMMENT 'in sec',
  PRIMARY KEY (`exercise_id`),
  KEY `exercise_type_id` (`exercise_type_id`),
  KEY `customer_id` (`customer_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;

-- Tábla adatainak mentése aitrainer.exercises: ~0 rows (hozzávetőleg)
/*!40000 ALTER TABLE `exercises` DISABLE KEYS */;
INSERT INTO `exercises` (`exercise_id`, `exercise_type_id`, `customer_id`, `date_add`, `quantity`, `unit`, `rest_time`) VALUES
	(1, 1, 1, '2020-05-01 00:00:00', 12, 'repeat', NULL, NULL);
/*!40000 ALTER TABLE `exercises` ENABLE KEYS */;

-- Struktúra mentése tábla aitrainer. exercise_evaluation
CREATE TABLE IF NOT EXISTS `exercise_evaluation` (
  `evaluation_id` int(11) NOT NULL AUTO_INCREMENT,
  `age_min` int(11) DEFAULT 0,
  `age_max` int(11) DEFAULT 0,
  `value_min` int(11) DEFAULT 0,
  `value_max` int(11) DEFAULT 0,
  `sex` enum('m','w') COLLATE utf8_hungarian_ci NOT NULL DEFAULT 'm',
  `evaluation` enum('excellent','very good','good','average','weak','poor') COLLATE utf8_hungarian_ci NOT NULL DEFAULT 'average',
  `description` mediumtext COLLATE utf8_hungarian_ci DEFAULT NULL,
  PRIMARY KEY (`evaluation_id`) USING BTREE,
  KEY `value_min_value_max` (`value_min`,`value_max`) USING BTREE,
  KEY `age_min_age_max` (`age_min`,`age_max`) USING BTREE,
  KEY `age_min_age_max_value_min_value_max` (`age_min`,`age_max`,`value_min`,`value_max`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;

-- Tábla adatainak mentése aitrainer.exercise_evaluation: ~0 rows (hozzávetőleg)
/*!40000 ALTER TABLE `exercise_evaluation` DISABLE KEYS */;
/*!40000 ALTER TABLE `exercise_evaluation` ENABLE KEYS */;

-- Struktúra mentése tábla aitrainer. exercise_type
CREATE TABLE `exercise_type` (
	`exercise_type_id` INT(11) NOT NULL AUTO_INCREMENT,
	`tree_id` INT(11) NOT NULL DEFAULT 0,
	`name` CHAR(100) NOT NULL COLLATE 'utf8_hungarian_ci',
	`description` VARCHAR(1000) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
	`unit` CHAR(50) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
	`unit_quantity` TINYINT(4) NULL DEFAULT NULL,
	`unit_quantity_unit` CHAR(50) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
	`active` TINYINT(1) NULL DEFAULT '1',
	`active` TINYINT(1) NULL DEFAULT '0',
	PRIMARY KEY (`exercise_type_id`) USING BTREE

-- Tábla adatainak mentése aitrainer.exercise_type: ~11 rows (hozzávetőleg)
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (1, 0, 'Melső fekvőtámasz 1 perc', 'Ezt igazolja a 2016 márciusában beállított guinness rekord is,\r\namelyben KJ Joseph 1 perc alatt 82 szabályos karhajlítás-nyújtást\r\nvégzett.', 'repeat', 60, 'second', NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (2, 0, 'Húzódzkodás', 'Ennek a gyakorlatnak a 24 órás csúcstartója Joonas Mäkipelto 5050\r\ngyakorlattal.', 'repeat', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (3, 0, 'Melső fekvőtámasz 30mp', 'A gyakorlatot 30 másodperc alatt olyan sokszor kell végrehajtani, ahányszor a\r\nfelvételiző képes rá. Azonban törekedni kell a szabályos végrehajtásra, ugyanis csak azokat\r\nszámolják. A nők esetében 20, a férfiak esetében 35 gyakorlatot kell végrehajtani a maximális\r\npont megszerzéséért. A gyakorlat akkor sikeres, ha a női legalább 1, a férfi felvételiző\r\nlegalább 11 gyakorlatot képes végrehajtani.', 'repeat', 30, 'second', NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (4, 0, 'Melső fekvőtámasz 2perc', 'Magyar Honvédség: A gyakorlat végrehajtására 2 perc áll rendelkezésre. Ennek során csak a szabályosan a\r\nfentiekben leírt módon végrehajtott gyakorlat értékelhető. Férfiaknál 70 karhajlítás nyújtást\r\nkell végrehajtani a maximális pontért.', 'repeat', 120, 'second', NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (5, 0, 'Hajlított karú függés', 'A gyakorlat addig tart, amíg a végrehajtó szemmagassága a kiinduló helyzettől\r\nsüllyedve a keresztvas alá nem kerül. Az értékeléshez stopperórát alkalmaznak, és az\r\neredmény másodperc pontossággal kerül megállapításra. Nők esetében 45, férfiak\r\ntekintetében 73 másodperctől jár a maximális pontszám. A gyakorlat sikeres végrehajtásához\r\nlegalább 8, 10 másodpercig kell megtartaniuk a kiinduló helyzetet a női és a férfi\r\nfelvételizőknek.\r\n\r\nA NKE-RTK-án lévő hallgatók egyéni rekordjai Iván Viktor 90s, Kiss Regina 74s', 'second', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (6, 0, 'Fekvenyomás', '2015-ben a fekvenyomó világbajnokságot Smulter Fredrik finn súlyemelő 401 Kg-al nyerte.\r\nA súlyzó tömege nők esetében 25 kg, a férfiak esetében 60 kg a rúddal együtt. Az\r\nértékelésénél a szabályosan végrehajtott gyakorlatokat értékelik csak.\r\nA legtöbb pontért 25 gyakorlatot kell végezni mind a nőknek, mind a férfiaknak. A minimum:\r\negy gyakorlat mindkét nem esetében.', 'repeat', NULL, 'kg', NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (7, 0, '4x10m-es ingafutás', 'A legjobb pontszámért 9,4 s illetve 8,8s alatt kell teljesíteni a nőknek, férfiaknak. A\r\ngyakorlat sikertelen 11,8 s illetve 11,2 s-on túl.', 'second', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (8, 0, 'Helyből távolugrás', 'Byron Jones 2015-ben a 3,73 méteres ugrásával érte el a világcsúcsot.\r\nA nőknek 220 cm-re, a férfiak 250 cm-re kell ugraniuk a maximális pontért. A\r\nminimális távolság 172cm illetve 198 cm.', 'meter', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (9, 0, 'Felülés hanyattfekvésből', 'Az NKE-RTK hallgatói közül Papp Zsófia 66 db-ot, Gál Valentin 80\r\ndb-ot csinált 1 perc leforgása alatt.\r\nElső ütemre megtörténik a felülés, ami akkor szabályos, ha valamelyik könyök érinti a\r\ntérdet. Második ütemre vissza kell térni a kiinduló helyzetbe. A maximális pont eléréséhez 1\r\nperc alatt 45 illetve 55 ismétlést kell végezni a nőknek illetve a férfiaknak. A minimumhoz 7\r\nés 25 ismétlés szükséges.', 'repeat', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (10, 0, 'Felülés hajlított térddel', 'Magyar Honvédség: A kiinduló helyzet hajlított ülés, ennek során a sarkak a talajon, a térd 90 fokban meghajlítva\r\nvan.\r\nA gyakorlat végrehajtására két perc áll rendelkezésre. Ennek során csak a szabályosan,\r\na fentiekben leírt módon végrehajtott gyakorlat értékelhető. Férfiaknál, nőknél egyaránt 90\r\ngyakorlatot kell végrehajtani a maximális pontért. Amennyiben a megadott időkeret alatt nem\r\nsikerül legalább 25 szabályos gyakorlatot végrehajtani, úgy az sikertelennek minősül.', 'repeat', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (11, 0, 'Síkfutás 2000m', 'A maximálisan megszerezhető pontot az a felvételiző gyűjtheti be, aki a távot nők\r\nesetében 10:00 perc alatt, férfiak esetében 7:35 perc alatt teljesíti. A gyakorlat sikeres\r\nteljesítésére nők esetében maximum 16:00 perc, férfiak esetében 13:30 perc áll rendelkezésre.', 'second', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (30, 0, 'Cooper', '12 minutes run, how many meters', 'meter', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (31, 0, '300m', NULL, 'second', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (32, 0, '400m', NULL, 'second', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (33, 0, 'Pushups', '', 'repeat', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (34, 0, 'Timed Pushups', NULL, 'repeat', 1, 'second', NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (35, 0, 'Squats', NULL, 'repeat', 1, 'kg', NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (36, 0, 'Sit-ups', NULL, 'repeat', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (37, 0, 'Chest Press', '', 'repeat', 1, 'kg', 1, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (38, 4, 'Pull Ups', '', 'repeat', NULL, NULL, 1, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (39, 0, 'Biceps', '', 'repeat', 1, 'kg', 1, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (40, 4, 'Triceps', 'Triceps', 'repeat', 1, 'kg', 1, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (41, 0, 'Shoulders', '', 'repeat', 1, 'kg', 1, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (42, 5, 'BMI', '', 'percent', 0, NULL, 1, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (43, 0, 'BMR', '', 'calorie', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (63, 4, 'Chest Press', '', 'repeat', 0, 'kilogram', 1, 0);

/*!40000 ALTER TABLE `exercise_type` DISABLE KEYS */;

CREATE TABLE `exercise_type_image` (
	`image_id` INT(13) NOT NULL AUTO_INCREMENT,
	`exercise_type_id` INT(13) NULL DEFAULT '0',
	`name` CHAR(50) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
	`url` CHAR(200) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
  `type` ENUM('menu','image','video') NULL DEFAULT 'image' COLLATE 'utf8mb4_general_ci',
	PRIMARY KEY (`image_id`) USING BTREE
)
COLLATE='utf8_hungarian_ci'
ENGINE=InnoDB
;

CREATE TABLE `exercise_type_translation` (
	`translation_id` INT(13) NOT NULL AUTO_INCREMENT,
	`language_code` CHAR(2) NOT NULL DEFAULT 'en' COLLATE 'utf8mb4_general_ci',
	`exercise_type_id` INT(13) NOT NULL DEFAULT '0',
	`name` CHAR(50) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`description` MEDIUMTEXT NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	PRIMARY KEY (`translation_id`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
;

CREATE TABLE `exercise_tree` (
	`tree_id` INT(11) NOT NULL AUTO_INCREMENT,
	`parent_id` INT(11) NOT NULL DEFAULT '0',
	`name` CHAR(50) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`image_url` CHAR(200) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`active` TINYINT(1) NULL DEFAULT '1',
	PRIMARY KEY (`item_id`) USING BTREE,
	INDEX `parent_id` (`parent_id`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
;

CREATE TABLE `exercise_tree_translation` (
	`translation_id` INT(13) NOT NULL AUTO_INCREMENT,
	`tree_id` INT(13) NOT NULL DEFAULT '0',
	`language_code` CHAR(2) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`name` CHAR(100) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	PRIMARY KEY (`translation_id`) USING BTREE,
	INDEX `tree_id` (`tree_id`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
;


CREATE TABLE `exercise_plan` (
	`exercise_plan_id` INT(11) NOT NULL AUTO_INCREMENT,
	`customer_id` INT(11) NOT NULL DEFAULT '0',
	`name` CHAR(50) NULL DEFAULT '0' COLLATE 'utf8mb4_general_ci',
	`description` TEXT(65535) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`private` TINYINT(4) NULL DEFAULT '0',
	`date_add` DATETIME NOT NULL,
	`date_upd` DATETIME NOT NULL,
	PRIMARY KEY (`exercise_plan_id`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
;

INSERT INTO `exercise_plan` (`exercise_plan_id`, `customer_id`, `name`, `description`, `private`, `date_add`, `date_upd`) VALUES (3, 90, 'Common', 'Common training plan', 0, NULL, NULL);
INSERT INTO `exercise_plan` (`exercise_plan_id`, `customer_id`, `name`, `description`, `private`, `date_add`, `date_upd`) VALUES (4, 90, 'Chuck Norris Plan', '', 0, NULL, NULL);
INSERT INTO `exercise_plan` (`exercise_plan_id`, `customer_id`, `name`, `description`, `private`, `date_add`, `date_upd`) VALUES (6, 90, 'Boss private', '', 1, '2020-09-08 00:06:26', NULL);
INSERT INTO `exercise_plan` (`exercise_plan_id`, `customer_id`, `name`, `description`, `private`, `date_add`, `date_upd`) VALUES (20, 90, 'Boss private 2', NULL, 1, '2020-09-09 00:06:19', NULL);


CREATE TABLE `exercise_plan_detail` (
	`exercise_plan_detail_id` INT(11) NOT NULL AUTO_INCREMENT,
	`exercise_plan_id` INT(11) NOT NULL DEFAULT '0',
	`exercise_type_id` INT(11) NOT NULL DEFAULT '0',
	`serie` INT(11) NOT NULL DEFAULT '0',
	`repeats` INT(11) NULL DEFAULT NULL,
	`weight_equation` CHAR(50) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	PRIMARY KEY (`exercise_plan_detail_id`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
;

INSERT INTO `exercise_plan_detail` (`exercise_plan_detail_id`, `exercise_plan_id`, `exercise_type_id`, `serie`, `repeats`, `weight_equation`) VALUES (1, 3, 35, 3, 20, '75%');
INSERT INTO `exercise_plan_detail` (`exercise_plan_detail_id`, `exercise_plan_id`, `exercise_type_id`, `serie`, `repeats`, `weight_equation`) VALUES (2, 3, 36, 3, 50, '75%');
INSERT INTO `exercise_plan_detail` (`exercise_plan_detail_id`, `exercise_plan_id`, `exercise_type_id`, `serie`, `repeats`, `weight_equation`) VALUES (3, 4, 37, 3, 12, '85%');
INSERT INTO `exercise_plan_detail` (`exercise_plan_detail_id`, `exercise_plan_id`, `exercise_type_id`, `serie`, `repeats`, `weight_equation`) VALUES (4, 6, 39, 3, 1, '40');
INSERT INTO `exercise_plan_detail` (`exercise_plan_detail_id`, `exercise_plan_id`, `exercise_type_id`, `serie`, `repeats`, `weight_equation`) VALUES (5, 6, 40, 12, 3, '40');


CREATE TABLE `exercise_plan_translation` (
	`translation_id` INT(11) NOT NULL AUTO_INCREMENT,
	`language_code` CHAR(2) NOT NULL DEFAULT '0' COLLATE 'utf8mb4_general_ci',
	`name` CHAR(50) NULL DEFAULT '0' COLLATE 'utf8mb4_general_ci',
	`description` TEXT(65535) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`exercise_plan_id` INT(11) NULL DEFAULT NULL,
	PRIMARY KEY (`translation_id`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
;

CREATE TABLE `product` (
	`product_id` INT(11) NOT NULL AUTO_INCREMENT,
	`name` CHAR(50) NOT NULL COLLATE 'utf8mb4_general_ci',
	`description` TEXT(65535) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`type` ENUM('subscription','in-app-currency') NOT NULL DEFAULT 'subscription' COLLATE 'utf8mb4_general_ci',
	`valid_from` DATE NULL DEFAULT NULL,
	`valid_to` DATE NULL DEFAULT NULL,
	PRIMARY KEY (`product_id`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
;

INSERT INTO `product` (`product_id`, `name`, `description`, `type`, `valid_from`, `valid_to`) VALUES (1, 'Subscription A', '700 Ft', 'subscription', '2020-11-01', NULL);
INSERT INTO `product` (`product_id`, `name`, `description`, `type`, `valid_from`, `valid_to`) VALUES (2, 'Subscription B', '1000 Ft', 'subscription', '2020-11-01', NULL);
INSERT INTO `product` (`product_id`, `name`, `description`, `type`, `valid_from`, `valid_to`) VALUES (3, 'Subscription C', '1500 Ft', 'subscription', '2020-11-01', NULL);
INSERT INTO `product` (`product_id`, `name`, `description`, `type`, `valid_from`, `valid_to`) VALUES (4, 'Subscription D', '2000 Ft', 'subscription', '2020-11-01', NULL);
INSERT INTO `product` (`product_id`, `name`, `description`, `type`, `valid_from`, `valid_to`) VALUES (5, 'Subscription E', '3000 Ft', 'subscription', '2020-11-01', NULL);
INSERT INTO `product` (`product_id`, `name`, `description`, `type`, `valid_from`, `valid_to`) VALUES (6, 'Subscription F', '5000 Ft', 'subscription', '2020-11-01', NULL);
INSERT INTO `product` (`product_id`, `name`, `description`, `type`, `valid_from`, `valid_to`) VALUES (7, 'Subscription A Yearly', '7000 Ft', 'subscription', '2020-11-01', NULL);
INSERT INTO `product` (`product_id`, `name`, `description`, `type`, `valid_from`, `valid_to`) VALUES (8, 'Subscription B Yearly', '10000', 'subscription', '2020-11-04', NULL);
INSERT INTO `product` (`product_id`, `name`, `description`, `type`, `valid_from`, `valid_to`) VALUES (9, 'Subscription C Yearly', '15000', 'subscription', '2020-11-04', NULL);
INSERT INTO `product` (`product_id`, `name`, `description`, `type`, `valid_from`, `valid_to`) VALUES (10, 'Subscription D Yearly', '20000', 'subscription', '2020-11-04', NULL);
INSERT INTO `product` (`product_id`, `name`, `description`, `type`, `valid_from`, `valid_to`) VALUES (11, 'Subscription E Yearly', '30000', 'subscription', '2020-11-04', NULL);
INSERT INTO `product` (`product_id`, `name`, `description`, `type`, `valid_from`, `valid_to`) VALUES (12, 'Subscription F Yearly', '50000', 'subscription', '2020-11-04', NULL);

CREATE TABLE `product_test` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`product_id` INT(11) NULL DEFAULT '0',
	`customer_id` INT(11) NULL DEFAULT '0',
	`date_view` DATETIME NULL DEFAULT NULL,
	`purchase_click` TINYINT(4) NULL DEFAULT '0',
	PRIMARY KEY (`id`) USING BTREE,
	INDEX `customer_id` (`customer_id`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
;

CREATE TABLE `purchase` (
	`purchase_id` INT(11) NOT NULL AUTO_INCREMENT,
	`customer_id` INT(11) NOT NULL DEFAULT '0',
	`product_id` INT(11) NOT NULL DEFAULT '0',
	`date_add` DATETIME NULL DEFAULT NULL,
	`purchase_sum` DOUBLE(22,0) NULL DEFAULT NULL,
	`currency` CHAR(3) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	PRIMARY KEY (`purchase_id`) USING BTREE,
	INDEX `customer_id` (`customer_id`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
;

INSERT INTO `purchase` (`purchase_id`, `customer_id`, `product_id`, `date_add`, `purchase_sum`, `currency`) VALUES (1, 62, 1, '2020-10-03 00:00:00', 1000, 'HUF');
INSERT INTO `purchase` (`purchase_id`, `customer_id`, `product_id`, `date_add`, `purchase_sum`, `currency`) VALUES (2, 62, 1, '2020-11-05 15:45:08', 1000, 'HUF');
INSERT INTO `purchase` (`purchase_id`, `customer_id`, `product_id`, `date_add`, `purchase_sum`, `currency`) VALUES (3, 2, 1, '2020-11-05 15:45:30', 1000, 'HUF');


/*!40000 ALTER TABLE `exercise_type` ENABLE KEYS */;

/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;

