API 1.0.31 sports

This commit is contained in:
Bossanyi Tibor
2021-04-20 09:28:43 +02:00
parent d71fb9e6d5
commit a5f6dc1bd8
15 changed files with 234 additions and 47 deletions
+53 -41
View File
@@ -279,31 +279,31 @@ CREATE TABLE IF NOT EXISTS `customer` (
`fitness_level` enum('beginner','intermediate','advanced','professional') COLLATE utf8_hungarian_ci NOT NULL DEFAULT 'beginner',
`body_type` enum('ectomorph','mesomorph','endomorph') COLLATE utf8_hungarian_ci DEFAULT NULL,
`firebase_uid` char(50) COLLATE utf8_hungarian_ci DEFAULT NULL,
`sport_id` INT(13) NULL DEFAULT NULL,
`email_subscription` TINYINT(1) NULL DEFAULT 0,
PRIMARY KEY (`customer_id`),
UNIQUE KEY `firebase_uid` (`firebase_uid`)
) ENGINE=InnoDB AUTO_INCREMENT=475 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;
) ENGINE=InnoDB AUTO_INCREMENT=140 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;
-- Tábla adatainak mentése aitrainer2.customer: ~17 rows (hozzávetőleg)
/*!40000 ALTER TABLE `customer` DISABLE KEYS */;
REPLACE 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, 'firebaseuid_customer_1'),
(2, 'Átlag 14 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL),
(3, 'Átlag 15 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL),
(4, 'Átlag 15 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 137, 0, 0, '', 'beginner', NULL, NULL),
(5, 'Átlag 16 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL),
(6, 'Átlag 17 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL),
(7, 'Átlag 18 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL),
(8, 'Átlag 13 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL),
(9, 'Átlag 14 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL),
(10, 'Átlag 15 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL),
(11, 'Átlag 16 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL),
(12, 'Átlag 17 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL),
(13, 'Átlag 18 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL),
(54, 'Dummy User', '', 'bosi', '$2a$10$thOc8jS750c7xe9U9Qq3GuSPs/H0Pt2Ads05yzUlyzQBIj.Rk9QCy', 'm', 0, 'N', NULL, NULL, 1, 1, 0, 0, 0, 0, '', 'beginner', NULL, NULL),
(90, 'Bossi', 'Tib', 'sw@andio.biz', '123456', 'm', 0, 'Y', NULL, '2021-04-14 22:42:33', 1, 1, 0, 0, 1972, 79, NULL, 'advanced', 'endomorph', NULL),
(103, 'Bos', 'Kakadu', 'sw2@andio.biz', NULL, 'm', 0, 'Y', NULL, '2021-04-14 22:42:33', 1, 1, 0, 137, 1972, 79, NULL, 'intermediate', NULL, '3FirebaseU1d'),
(137, 'Robert', '', NULL, NULL, 'm', NULL, 'N', NULL, NULL, 1, 0, 1, 0, 0, 0, '', 'beginner', NULL, NULL);
/*!40000 ALTER TABLE `customer` ENABLE 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`, `sport_id`, `email_subscription`) VALUES (1, 'Átlag 13 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 137, 0, 0, '', 'beginner', NULL, 'firebaseuid_customer_1', 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`, `sport_id`, `email_subscription`) VALUES (2, 'Átlag 14 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL, 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`, `sport_id`, `email_subscription`) VALUES (3, 'Átlag 15 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL, 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`, `sport_id`, `email_subscription`) VALUES (4, 'Átlag 15 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 137, 0, 0, '', 'beginner', NULL, NULL, 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`, `sport_id`, `email_subscription`) VALUES (5, 'Átlag 16 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL, 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`, `sport_id`, `email_subscription`) VALUES (6, 'Átlag 17 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL, 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`, `sport_id`, `email_subscription`) VALUES (7, 'Átlag 18 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL, 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`, `sport_id`, `email_subscription`) VALUES (8, 'Átlag 13 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL, 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`, `sport_id`, `email_subscription`) VALUES (9, 'Átlag 14 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL, 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`, `sport_id`, `email_subscription`) VALUES (10, 'Átlag 15 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL, 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`, `sport_id`, `email_subscription`) VALUES (11, 'Átlag 16 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL, 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`, `sport_id`, `email_subscription`) VALUES (12, 'Átlag 17 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL, 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`, `sport_id`, `email_subscription`) VALUES (13, 'Átlag 18 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, 0, 0, '', 'beginner', NULL, NULL, 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`, `sport_id`, `email_subscription`) VALUES (54, 'Dummy User', '', 'bosi', '$2a$10$thOc8jS750c7xe9U9Qq3GuSPs/H0Pt2Ads05yzUlyzQBIj.Rk9QCy', 'm', 0, 'N', NULL, NULL, 1, 1, 0, 0, 0, 0, '', 'beginner', NULL, NULL, 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`, `sport_id`, `email_subscription`) VALUES (90, 'Bossi', 'Tib', 'sw@andio.biz', '123456', 'm', 0, 'Y', NULL, '2021-04-19 20:42:31', 1, 1, 0, 0, 1972, 79, NULL, 'advanced', 'endomorph', NULL, 2, 1);
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`, `sport_id`, `email_subscription`) VALUES (103, 'Bos', 'Kakadu', 'sw2@andio.biz', NULL, 'm', 0, 'Y', NULL, '2021-04-19 20:42:31', 1, 1, 0, 137, 1972, 79, NULL, 'intermediate', NULL, '3FirebaseU1d', 0, 0);
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`, `sport_id`, `email_subscription`) VALUES (137, 'Robert', '', NULL, NULL, 'm', NULL, 'N', NULL, NULL, 1, 0, 1, 0, 0, 0, '', 'beginner', NULL, NULL, 0, 0);
-- Struktúra mentése tábla aitrainer2. customer_activity
CREATE TABLE IF NOT EXISTS `customer_activity` (
@@ -339,26 +339,6 @@ REPLACE INTO `customer_exercise_device` (`customer_exercise_device_id`, `custome
(21, 90, 5, NULL, NULL);
/*!40000 ALTER TABLE `customer_exercise_device` ENABLE KEYS */;
-- Struktúra mentése tábla aitrainer2. 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 AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;
-- Tábla adatainak mentése aitrainer2.customer_information: ~3 rows (hozzávetőleg)
/*!40000 ALTER TABLE `customer_information` DISABLE KEYS */;
REPLACE 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'),
(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'),
(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');
/*!40000 ALTER TABLE `customer_information` ENABLE KEYS */;
-- Struktúra mentése tábla aitrainer2. customer_property
CREATE TABLE IF NOT EXISTS `customer_property` (
`customer_property_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
@@ -1361,6 +1341,38 @@ CREATE TABLE IF NOT EXISTS `tracking` (
KEY `event` (`event`)
) ENGINE=InnoDB AUTO_INCREMENT=90 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;
CREATE TABLE `sport` (
`sport_id` INT(11) NOT NULL AUTO_INCREMENT,
`name` CHAR(50) NOT NULL COLLATE 'utf8_hungarian_ci',
PRIMARY KEY (`sport_id`) USING BTREE
)
COLLATE='utf8_hungarian_ci'
ENGINE=InnoDB
;
INSERT INTO `sport` (`sport_id`, `name`) VALUES (3, 'Fitness / Body Building');
INSERT INTO `sport` (`sport_id`, `name`) VALUES (1, 'Football');
INSERT INTO `sport` (`sport_id`, `name`) VALUES (2, 'Footgolf');
INSERT INTO `sport` (`sport_id`, `name`) VALUES (4, 'Tennis');
CREATE TABLE IF NOT EXISTS `sport_translation` (
`translation_id` int(13) NOT NULL AUTO_INCREMENT,
`language_code` char(2) NOT NULL DEFAULT 'en',
`sport_id` int(13) NOT NULL DEFAULT 0,
`sport_name` char(50) DEFAULT NULL,
PRIMARY KEY (`translation_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
INSERT INTO `sport_translation` (`translation_id`, `language_code`, `sport_id`, `sport_name`) VALUES (2, 'hu', 1, 'Labdarúgás');
INSERT INTO `sport_translation` (`translation_id`, `language_code`, `sport_id`, `sport_name`) VALUES (3, 'hu', 2, 'Footgolf');
INSERT INTO `sport_translation` (`translation_id`, `language_code`, `sport_id`, `sport_name`) VALUES (4, 'hu', 3, 'Fitnesz / Body Building');
INSERT INTO `sport_translation` (`translation_id`, `language_code`, `sport_id`, `sport_name`) VALUES (5, 'hu', 4, 'Tenisz');
-- Tábla adatainak mentése aitrainer2.tracking: ~0 rows (hozzávetőleg)
/*!40000 ALTER TABLE `tracking` DISABLE KEYS */;
/*!40000 ALTER TABLE `tracking` ENABLE KEYS */;
+30
View File
@@ -0,0 +1,30 @@
START TRANSACTION;
CREATE TABLE `sport` (
`sport_id` INT(11) NOT NULL AUTO_INCREMENT,
`name` CHAR(50) NOT NULL COLLATE 'utf8_hungarian_ci',
PRIMARY KEY (`sport_id`) USING BTREE
)
COLLATE='utf8_hungarian_ci'
ENGINE=InnoDB
;
CREATE TABLE IF NOT EXISTS `sport_translation` (
`translation_id` int(13) NOT NULL AUTO_INCREMENT,
`language_code` char(2) NOT NULL DEFAULT 'en',
`sport_id` int(13) NOT NULL DEFAULT 0,
`sport_name` char(50) DEFAULT NULL,
PRIMARY KEY (`translation_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
ALTER TABLE `customer`
ADD COLUMN `sport_id` INT(13) NULL DEFAULT NULL AFTER `firebase_uid`;
ALTER TABLE `customer`
ADD COLUMN `email_subscription` TINYINT(1) NULL DEFAULT 0 AFTER `sport_id`;
UPDATE configuration set config_value = "1.0.31", date_change=CURRENT_DATE WHERE config_key = "db_version";
COMMIT;