1.0.4: customer fields extensions, tests

This commit is contained in:
Bossanyi Tibor
2020-07-05 13:50:28 +02:00
parent 2bd3f2232d
commit 6f570242e1
10 changed files with 91 additions and 28 deletions
+22 -15
View File
@@ -26,25 +26,32 @@ CREATE TABLE IF NOT EXISTS `customer` (
`date_change` datetime DEFAULT NULL,
`data_policy_allowed` tinyint(4) DEFAULT 1,
`admin` tinyint(4) 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',
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`) VALUES
(1, 'Átlag 13 éves fiú', '', NULL, NULL, 'm', 13, 'N', NULL, NULL, 1, 0),
(2, 'Átlag 14 éves fiú', '', NULL, NULL, 'm', 14, 'N', NULL, NULL, 1, 0),
(3, 'Átlag 15 éves fiú', '', NULL, NULL, 'm', 15, 'N', NULL, NULL, 1, 0),
(4, 'Átlag 15 éves fiú', '', NULL, NULL, 'm', 15, 'N', NULL, NULL, 1, 0),
(5, 'Átlag 16 éves fiú', '', NULL, NULL, 'm', 16, 'N', NULL, NULL, 1, 0),
(6, 'Átlag 17 éves fiú', '', NULL, NULL, 'm', 17, 'N', NULL, NULL, 1, 0),
(7, 'Átlag 18 éves fiú', '', NULL, NULL, 'm', 18, 'N', NULL, NULL, 1, 0),
(8, 'Átlag 13 éves lány', '', NULL, NULL, 'w', 13, 'N', NULL, NULL, 1, 0),
(9, 'Átlag 14 éves lány', '', NULL, NULL, 'w', 14, 'N', NULL, NULL, 1, 0),
(10, 'Átlag 15 éves lány', '', NULL, NULL, 'w', 15, 'N', NULL, NULL, 1, 0),
(11, 'Átlag 16 éves lány', '', NULL, NULL, 'w', 16, 'N', NULL, NULL, 1, 0),
(12, 'Átlag 17 éves lány', '', NULL, NULL, 'w', 17, 'N', NULL, NULL, 1, 0),
(13, 'Átlag 18 éves lány', '', NULL, NULL, 'w', 18, 'N', NULL, NULL, 1, 0);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`) VALUES (1, 'Átlag 13 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 0, '', 'beginner', NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`) VALUES (2, 'Átlag 14 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 0, '', 'beginner', NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`) VALUES (3, 'Átlag 15 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 0, '', 'beginner', NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`) VALUES (4, 'Átlag 15 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 0, '', 'beginner', NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`) VALUES (5, 'Átlag 16 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 0, '', 'beginner', NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`) VALUES (6, 'Átlag 17 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 0, '', 'beginner', NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`) VALUES (7, 'Átlag 18 éves fiú', '', '', NULL, 'm', 0, 'N', NULL, NULL, 1, 0, 0, 0, '', 'beginner', NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`) VALUES (8, 'Átlag 13 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, '', 'beginner', NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`) VALUES (9, 'Átlag 14 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, '', 'beginner', NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`) VALUES (10, 'Átlag 15 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, '', 'beginner', NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`) VALUES (11, 'Átlag 16 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, '', 'beginner', NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`) VALUES (12, 'Átlag 17 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, '', 'beginner', NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`) VALUES (13, 'Átlag 18 éves lány', '', '', NULL, 'w', 0, 'N', NULL, NULL, 1, 0, 0, 0, '', 'beginner', NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`) VALUES (54, 'Dummy User', '', 'bosi', '$2a$10$thOc8jS750c7xe9U9Qq3GuSPs/H0Pt2Ads05yzUlyzQBIj.Rk9QCy', 'm', 0, 'N', NULL, NULL, 1, 1, 0, 0, '', 'beginner', NULL);
INSERT INTO `customer` (`customer_id`, `name`, `firstname`, `email`, `password`, `sex`, `age`, `active`, `date_add`, `date_change`, `data_policy_allowed`, `admin`, `birth_year`, `weight`, `goal`, `fitness_level`, `body_type`) VALUES (90, 'Bossi', 'Tib', 'sw@andio.biz', '', 'm', 0, 'Y', NULL, NULL, 1, 1, 0, 0, '', 'beginner', NULL);
/*!40000 ALTER TABLE `customer` ENABLE KEYS */;
-- Struktúra mentése tábla aitrainer. customer_information
@@ -86,7 +93,7 @@ CREATE TABLE IF NOT EXISTS `exercises` (
-- 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);
(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
+12
View File
@@ -0,0 +1,12 @@
ALTER TABLE `customer`
ADD COLUMN `birth_year` INT(4) NULL DEFAULT '0' AFTER `admin`,
ADD COLUMN `weight` INT(3) NULL DEFAULT '0' AFTER `birth_year`,
ADD COLUMN `goal` CHAR(20) NULL DEFAULT '' AFTER `weight`,
ADD COLUMN `fitness_level` ENUM('beginner','intermediate', 'advanced', 'professional') NOT NULL DEFAULT 'beginner' COLLATE 'utf8_hungarian_ci' after `goal`,
ADD COLUMN `body_type` ENUM('ectomorph','mesomorph', 'endomorph') NULL COLLATE 'utf8_hungarian_ci' after `fitness_level`;
ALTER TABLE `exercises`
CHANGE COLUMN `quantity` `quantity` DOUBLE NULL DEFAULT NULL AFTER `date_add`,
CHANGE COLUMN `unit_quantity` `unit_quantity` DOUBLE NULL DEFAULT NULL AFTER `unit`;
UPDATE configuration set config_value = "1.0.4" WHERE config_key = "db_version";