API 1.0.18 Tree Parents

This commit is contained in:
Bossanyi Tibor
2020-12-03 18:39:59 +01:00
parent e640f52b36
commit 293379d6fd
10 changed files with 103 additions and 13 deletions
+60 -9
View File
@@ -589,13 +589,51 @@ CREATE TABLE IF NOT EXISTS `exercise_tree` (
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4;
-- Tábla adatainak mentése aitrainer2.exercise_tree: ~3 rows (hozzávetőleg)
/*!40000 ALTER TABLE `exercise_tree` DISABLE KEYS */;
REPLACE INTO `exercise_tree` (`tree_id`, `parent_id`, `name`, `image_url`, `active`) VALUES
(3, 0, 'Cardio', 'images/1.cardio_7TNRbEU.png', 1),
(4, 0, 'Strength', 'images/2.strength.png', 1),
(5, 0, 'Body Compositions', 'images/3.bcs1.png', 1),
(6, 2, '1RM', 'images/2.2.1.1RM.png', 1);
/*!40000 ALTER TABLE `exercise_tree` ENABLE KEYS */;
(3, 0, 'Cardio', 'images/1.cardio.png', 1),
(4, 0, 'Strength', 'images/2.strength.png', 1),
(5, 0, 'Body Compositions', 'images/3.bcs1.png', 1),
(7, 3, 'Aerob', 'images/1.1.aerob.png', 1),
(8, 3, 'Anaerob', 'images/1.2.anaerob.png', 1),
(9, 4, 'One Rep Max', 'images/2.2.1.1RM.png', 1),
(10, 4, 'Endurance', 'images/2.1.endurance.png', 1),
(11, 5, 'BMI', 'images/3.1.BMI.png', 0),
(12, 5, 'BMR', 'images/3.2.BMR.png', 0),
(13, 5, 'Sizes', 'images/3.3.sizes.png', 0),
(14, 9, 'Chest', 'images/2.2.1.1.chestpress.png', 1),
(15, 9, 'Biceps', 'images/2.2.1.3.biceps.png', 1),
(16, 9, 'Triceps', 'images/2.2.1.4.triceps.png', 1),
(17, 9, 'Shoulders', 'images/2.2.1.5.shoulders.png', 1),
(18, 9, 'Thigh', 'images/2.1.4.squats.png', 1),
(19, 9, 'Calf', 'images/2.1.4.squats.png', 1),
(20, 9, 'Back', 'images/2.2.1.5.shoulders.png', 1);
CREATE TABLE IF NOT EXISTS `exercise_tree_parents` (
`exercise_tree_parents_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`exercise_tree_parent_id` int(11) NOT NULL DEFAULT 0,
`exercise_tree_child_id` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`exercise_tree_parents_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (15, 0, 3);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (16, 0, 4);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (17, 0, 5);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (18, 2, 6);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (19, 3, 7);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (20, 3, 8);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (21, 4, 9);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (22, 4, 10);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (23, 5, 11);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (24, 5, 12);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (25, 5, 13);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (26, 9, 14);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (27, 9, 15);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (28, 9, 16);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (29, 9, 17);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (30, 9, 18);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (31, 9, 19);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (32, 9, 20);
-- Struktúra mentése tábla aitrainer2. exercise_tree_translation
CREATE TABLE IF NOT EXISTS `exercise_tree_translation` (
@@ -610,9 +648,22 @@ CREATE TABLE IF NOT EXISTS `exercise_tree_translation` (
-- Tábla adatainak mentése aitrainer2.exercise_tree_translation: ~2 rows (hozzávetőleg)
/*!40000 ALTER TABLE `exercise_tree_translation` DISABLE KEYS */;
REPLACE INTO `exercise_tree_translation` (`translation_id`, `tree_id`, `language_code`, `name`) VALUES
(1, 3, 'hu', 'Kardió'),
(2, 4, 'hu', 'Erő'),
(3, 6, 'hu', '1RM');
(1, 3, 'hu', 'Kardió'),
(2, 4, 'hu', 'Erő'),
(4, 7, 'hu', 'Aerob'),
(5, 8, 'hu', 'Anaerob'),
(6, 9, 'hu', 'Max Erő'),
(7, 10, 'hu', 'Erő állóképesség'),
(8, 11, 'hu', 'Testtömegindex'),
(9, 12, 'hu', 'Anyagcsere'),
(10, 13, 'hu', 'Méretek'),
(11, 14, 'hu', 'Mellizom'),
(12, 15, 'hu', 'Bicepsz'),
(13, 16, 'hu', 'Tricepsz'),
(14, 17, 'hu', 'Vállak'),
(15, 18, 'hu', 'Comb'),
(16, 19, 'hu', 'Vádli'),
(17, 20, 'hu', 'Hát');
/*!40000 ALTER TABLE `exercise_tree_translation` ENABLE KEYS */;
-- Struktúra mentése tábla aitrainer2. exercise_type
+11
View File
@@ -0,0 +1,11 @@
CREATE TABLE IF NOT EXISTS `exercise_tree_parents` (
`exercise_tree_parents_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`exercise_tree_parent_id` int(11) NOT NULL DEFAULT 0,
`exercise_tree_child_id` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`exercise_tree_parents_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;
INSERT INTO exercise_tree_parents (exercise_tree_parent_id, exercise_tree_child_id)
SELECT parent_id, tree_id FROM exercise_tree;
UPDATE configuration set config_value = "1.0.18", date_change=CURRENT_DATE WHERE config_key = "db_version";