diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 6978a27..da436c1 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -61,6 +61,9 @@ PODS: - Flutter (1.0.0) - flutter_keyboard_visibility (0.0.1): - Flutter + - FMDB (2.7.5): + - FMDB/standard (= 2.7.5) + - FMDB/standard (2.7.5) - GoogleDataTransport (7.5.1): - nanopb (~> 1.30906.0) - GoogleUtilities/AppDelegateSwizzler (6.7.2): @@ -92,6 +95,9 @@ PODS: - Protobuf (3.13.0) - shared_preferences (0.0.1): - Flutter + - sqflite (0.0.2): + - Flutter + - FMDB (>= 2.7.5) DEPENDENCIES: - devicelocale (from `.symlinks/plugins/devicelocale/ios`) @@ -103,6 +109,7 @@ DEPENDENCIES: - flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`) - path_provider (from `.symlinks/plugins/path_provider/ios`) - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) + - sqflite (from `.symlinks/plugins/sqflite/ios`) SPEC REPOS: trunk: @@ -114,6 +121,7 @@ SPEC REPOS: - FirebaseInstanceID - FirebaseMessaging - Flurry-iOS-SDK + - FMDB - GoogleDataTransport - GoogleUtilities - GTMSessionFetcher @@ -140,6 +148,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/path_provider/ios" shared_preferences: :path: ".symlinks/plugins/shared_preferences/ios" + sqflite: + :path: ".symlinks/plugins/sqflite/ios" SPEC CHECKSUMS: devicelocale: feebbe5e7a30adb8c4f83185de1b50ff19b44f00 @@ -157,6 +167,7 @@ SPEC CHECKSUMS: Flurry-iOS-SDK: 8f3f7fce27177002f15f145eede88dc1b9ac0cd0 Flutter: 0e3d915762c693b495b44d77113d4970485de6ec flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069 + FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833 GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3 GTMSessionFetcher: b3503b20a988c4e20cc189aa798fd18220133f52 @@ -165,6 +176,7 @@ SPEC CHECKSUMS: PromisesObjC: 8c196f5a328c2cba3e74624585467a557dcb482f Protobuf: 3dac39b34a08151c6d949560efe3f86134a3f748 shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d + sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c diff --git a/lib/helper/database.dart b/lib/helper/database.dart new file mode 100644 index 0000000..0d29c8a --- /dev/null +++ b/lib/helper/database.dart @@ -0,0 +1,35 @@ +import 'dart:io'; + +import 'package:sqflite/sqflite.dart'; + +class DB { + static final DB _singleton = DB._internal(); + String dbName = "workouttest.db"; + Database _db; + + factory DB() { + return _singleton; + } + + DB._internal() { + dbName = 'workouttest.db'; + } + + Future initDb() async { + _db = await openDatabase(dbName); + + File dbFile = File('database.sql'); + String contents = await dbFile.readAsString(); + + List commands = contents.split(";"); + commands.forEach((sqlCommand) { + if (!sqlCommand.startsWith("--")) { + DB().getDB().execute(sqlCommand); + } + }); + } + + Future closeDb() async => this._db.close(); + + Database getDB() => this._db; +} diff --git a/lib/helper/database.sql b/lib/helper/database.sql new file mode 100755 index 0000000..54991d5 --- /dev/null +++ b/lib/helper/database.sql @@ -0,0 +1,824 @@ +-- -------------------------------------------------------- +-- Host: 127.0.0.1 +-- Szerver verzió: 10.4.11-MariaDB - mariadb.org binary distribution +-- Szerver OS: Win64 +-- HeidiSQL Verzió: 11.1.0.6116 +-- -------------------------------------------------------- + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; +/*!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' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + + +-- Tábla adatainak mentése aitrainer2.auth_group: ~0 rows (hozzávetőleg) +/*!40000 ALTER TABLE `auth_group` DISABLE KEYS */; +/*!40000 ALTER TABLE `auth_group` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. auth_group_permissions +CREATE TABLE IF NOT EXISTS `auth_group_permissions` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `group_id` int(11) NOT NULL, + `permission_id` int(11) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `auth_group_permissions_group_id_permission_id_0cd325b0_uniq` (`group_id`,`permission_id`), + KEY `auth_group_permissio_permission_id_84c5c92e_fk_auth_perm` (`permission_id`), + CONSTRAINT `auth_group_permissio_permission_id_84c5c92e_fk_auth_perm` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`), + CONSTRAINT `auth_group_permissions_group_id_b120cbf9_fk_auth_group_id` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci; + +-- Tábla adatainak mentése aitrainer2.auth_group_permissions: ~0 rows (hozzávetőleg) +/*!40000 ALTER TABLE `auth_group_permissions` DISABLE KEYS */; +/*!40000 ALTER TABLE `auth_group_permissions` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. auth_permission +CREATE TABLE IF NOT EXISTS `auth_permission` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) COLLATE utf8_hungarian_ci NOT NULL, + `content_type_id` int(11) NOT NULL, + `codename` varchar(100) COLLATE utf8_hungarian_ci NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `auth_permission_content_type_id_codename_01ab375a_uniq` (`content_type_id`,`codename`), + CONSTRAINT `auth_permission_content_type_id_2f476e4b_fk_django_co` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci; + +-- Tábla adatainak mentése aitrainer2.auth_permission: ~32 rows (hozzávetőleg) +/*!40000 ALTER TABLE `auth_permission` DISABLE KEYS */; +REPLACE INTO `auth_permission` (`id`, `name`, `content_type_id`, `codename`) VALUES + (1, 'Can add exercise type', 1, 'add_exercisetype'), + (2, 'Can change exercise type', 1, 'change_exercisetype'), + (3, 'Can delete exercise type', 1, 'delete_exercisetype'), + (4, 'Can view exercise type', 1, 'view_exercisetype'), + (5, 'Can add exercise type image', 2, 'add_exercisetypeimage'), + (6, 'Can change exercise type image', 2, 'change_exercisetypeimage'), + (7, 'Can delete exercise type image', 2, 'delete_exercisetypeimage'), + (8, 'Can view exercise type image', 2, 'view_exercisetypeimage'), + (9, 'Can add log entry', 3, 'add_logentry'), + (10, 'Can change log entry', 3, 'change_logentry'), + (11, 'Can delete log entry', 3, 'delete_logentry'), + (12, 'Can view log entry', 3, 'view_logentry'), + (13, 'Can add permission', 4, 'add_permission'), + (14, 'Can change permission', 4, 'change_permission'), + (15, 'Can delete permission', 4, 'delete_permission'), + (16, 'Can view permission', 4, 'view_permission'), + (17, 'Can add group', 5, 'add_group'), + (18, 'Can change group', 5, 'change_group'), + (19, 'Can delete group', 5, 'delete_group'), + (20, 'Can view group', 5, 'view_group'), + (21, 'Can add user', 6, 'add_user'), + (22, 'Can change user', 6, 'change_user'), + (23, 'Can delete user', 6, 'delete_user'), + (24, 'Can view user', 6, 'view_user'), + (25, 'Can add content type', 7, 'add_contenttype'), + (26, 'Can change content type', 7, 'change_contenttype'), + (27, 'Can delete content type', 7, 'delete_contenttype'), + (28, 'Can view content type', 7, 'view_contenttype'), + (29, 'Can add session', 8, 'add_session'), + (30, 'Can change session', 8, 'change_session'), + (31, 'Can delete session', 8, 'delete_session'), + (32, 'Can view session', 8, 'view_session'); +/*!40000 ALTER TABLE `auth_permission` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. auth_user +CREATE TABLE IF NOT EXISTS `auth_user` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `password` varchar(128) COLLATE utf8_hungarian_ci NOT NULL, + `last_login` datetime(6) DEFAULT NULL, + `is_superuser` tinyint(1) NOT NULL, + `username` varchar(150) COLLATE utf8_hungarian_ci NOT NULL, + `first_name` varchar(30) COLLATE utf8_hungarian_ci NOT NULL, + `last_name` varchar(150) COLLATE utf8_hungarian_ci NOT NULL, + `email` varchar(254) COLLATE utf8_hungarian_ci NOT NULL, + `is_staff` tinyint(1) NOT NULL, + `is_active` tinyint(1) NOT NULL, + `date_joined` datetime(6) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `username` (`username`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci; + +-- Tábla adatainak mentése aitrainer2.auth_user: ~2 rows (hozzávetőleg) +/*!40000 ALTER TABLE `auth_user` DISABLE KEYS */; +REPLACE INTO `auth_user` (`id`, `password`, `last_login`, `is_superuser`, `username`, `first_name`, `last_name`, `email`, `is_staff`, `is_active`, `date_joined`) VALUES + (1, 'pbkdf2_sha256$180000$WhaET4L6Ebme$JTn/z9eX1S0zZVJeO0saJClgwakCR9PXIBYXQtVHBjs=', '2020-11-19 19:36:52.009635', 1, 'bossanyit', '', '', 'tibor.bossanyi@aitrainer.app', 1, 1, '2020-07-15 20:42:37.000000'), + (2, 'pbkdf2_sha256$180000$KWuUPcTheOKy$r3pccArHppBYlHIPxb9bInGPLxFmLKMBUXwuPrcQ/2w=', NULL, 0, 'bossanyiz', '', '', '', 1, 1, '2020-07-15 21:17:11.000000'); +/*!40000 ALTER TABLE `auth_user` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. auth_user_groups +CREATE TABLE IF NOT EXISTS `auth_user_groups` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `group_id` int(11) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `auth_user_groups_user_id_group_id_94350c0c_uniq` (`user_id`,`group_id`), + KEY `auth_user_groups_group_id_97559544_fk_auth_group_id` (`group_id`), + CONSTRAINT `auth_user_groups_group_id_97559544_fk_auth_group_id` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`), + CONSTRAINT `auth_user_groups_user_id_6a12ed8b_fk_auth_user_id` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci; + +-- Tábla adatainak mentése aitrainer2.auth_user_groups: ~0 rows (hozzávetőleg) +/*!40000 ALTER TABLE `auth_user_groups` DISABLE KEYS */; +/*!40000 ALTER TABLE `auth_user_groups` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. auth_user_user_permissions +CREATE TABLE IF NOT EXISTS `auth_user_user_permissions` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `permission_id` int(11) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `auth_user_user_permissions_user_id_permission_id_14a6b632_uniq` (`user_id`,`permission_id`), + KEY `auth_user_user_permi_permission_id_1fbb5f2c_fk_auth_perm` (`permission_id`), + CONSTRAINT `auth_user_user_permi_permission_id_1fbb5f2c_fk_auth_perm` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`), + CONSTRAINT `auth_user_user_permissions_user_id_a95ead1b_fk_auth_user_id` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci; + +-- Tábla adatainak mentése aitrainer2.auth_user_user_permissions: ~12 rows (hozzávetőleg) +/*!40000 ALTER TABLE `auth_user_user_permissions` DISABLE KEYS */; +REPLACE INTO `auth_user_user_permissions` (`id`, `user_id`, `permission_id`) VALUES + (1, 2, 1), + (2, 2, 2), + (3, 2, 3), + (4, 2, 4), + (5, 2, 5), + (6, 2, 6), + (7, 2, 7), + (8, 2, 8), + (9, 2, 12), + (10, 2, 20), + (11, 2, 24), + (12, 2, 28); +/*!40000 ALTER TABLE `auth_user_user_permissions` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. configuration +CREATE TABLE IF NOT EXISTS `configuration` ( + `configuration_id` int(11) NOT NULL AUTO_INCREMENT, + `config_key` char(50) COLLATE utf8_hungarian_ci DEFAULT NULL, + `config_value` char(50) COLLATE utf8_hungarian_ci DEFAULT NULL, + `date_add` datetime DEFAULT NULL, + `date_change` datetime DEFAULT NULL, + PRIMARY KEY (`configuration_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci; + +-- Tábla adatainak mentése aitrainer2.configuration: ~0 rows (hozzávetőleg) +/*!40000 ALTER TABLE `configuration` DISABLE KEYS */; +REPLACE INTO `configuration` (`configuration_id`, `config_key`, `config_value`, `date_add`, `date_change`) VALUES + (1, 'db_version', '1.0.16', '2020-05-30 07:00:00', '2020-11-26 00:00:00'); +/*!40000 ALTER TABLE `configuration` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. 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) DEFAULT 0, + `birth_year` int(4) DEFAULT 0, + `weight` int(3) DEFAULT 0, + `goal` char(20) COLLATE utf8_hungarian_ci DEFAULT '', + `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, + PRIMARY KEY (`customer_id`), + UNIQUE KEY `firebase_uid` (`firebase_uid`) +) ENGINE=InnoDB AUTO_INCREMENT=296 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', '123456789', 'm', 0, 'Y', NULL, NULL, 1, 1, 0, 137, 1972, 79, NULL, 'advanced', 'endomorph', NULL), + (103, 'Bos', 'Kakadu', 'sw2@andio.biz', 'blabal', 'm', 0, 'N', NULL, NULL, 0, 0, 0, 0, 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 */; + +-- Struktúra mentése tábla aitrainer2. customer_exercise_device +CREATE TABLE IF NOT EXISTS `customer_exercise_device` ( + `customer_exercise_device_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `customer_id` int(11) NOT NULL DEFAULT 0, + `exercise_device_id` int(11) NOT NULL DEFAULT 0, + `date_add` datetime DEFAULT NULL, + `favourite` tinyint(4) DEFAULT NULL, + PRIMARY KEY (`customer_exercise_device_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci; + +-- Tábla adatainak mentése aitrainer2.customer_exercise_device: ~2 rows (hozzávetőleg) +/*!40000 ALTER TABLE `customer_exercise_device` DISABLE KEYS */; +REPLACE INTO `customer_exercise_device` (`customer_exercise_device_id`, `customer_id`, `exercise_device_id`, `date_add`, `favourite`) VALUES + (1, 90, 1, NULL, NULL), + (2, 90, 2, NULL, NULL); +/*!40000 ALTER TABLE `customer_exercise_device` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. customer_information +DROP TABLE IF EXISTS `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 */; +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'), + (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 +DROP TABLE IF EXISTS `customer_property`; +CREATE TABLE IF NOT EXISTS `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 DEFAULT NULL, + PRIMARY KEY (`customer_property_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=65 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci; + +-- Tábla adatainak mentése aitrainer2.customer_property: ~7 rows (hozzávetőleg) +/*!40000 ALTER TABLE `customer_property` DISABLE KEYS */; +INSERT INTO `customer_property` (`customer_property_id`, `customer_id`, `property_id`, `property_value`, `date_add`) VALUES + (1, 90, 1, 81, '2020-09-09 21:53:29'), + (2, 90, 1, 82, '2020-11-09 21:53:53'), + (3, 90, 2, 172, '2020-09-09 21:55:18'), + (4, 90, 4, 37, '2020-09-09 21:55:51'), + (5, 91, 1, 67, '2020-10-09 22:12:24'), + (45, 90, 1, 79, '2020-11-10 07:34:35'), + (46, 103, 1, 79, '2020-11-10 07:34:35'); +/*!40000 ALTER TABLE `customer_property` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. django_admin_log +DROP TABLE IF EXISTS `django_admin_log`; +CREATE TABLE IF NOT EXISTS `django_admin_log` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `action_time` datetime(6) NOT NULL, + `object_id` longtext COLLATE utf8_hungarian_ci DEFAULT NULL, + `object_repr` varchar(200) COLLATE utf8_hungarian_ci NOT NULL, + `action_flag` smallint(5) unsigned NOT NULL CHECK (`action_flag` >= 0), + `change_message` longtext COLLATE utf8_hungarian_ci NOT NULL, + `content_type_id` int(11) DEFAULT NULL, + `user_id` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `django_admin_log_content_type_id_c4bce8eb_fk_django_co` (`content_type_id`), + KEY `django_admin_log_user_id_c564eba6_fk_auth_user_id` (`user_id`), + CONSTRAINT `django_admin_log_content_type_id_c4bce8eb_fk_django_co` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`), + CONSTRAINT `django_admin_log_user_id_c564eba6_fk_auth_user_id` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=70 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci; + +-- Tábla adatainak mentése aitrainer2.django_admin_log: ~60 rows (hozzávetőleg) +/*!40000 ALTER TABLE `django_admin_log` DISABLE KEYS */; +INSERT INTO `django_admin_log` (`id`, `action_time`, `object_id`, `object_repr`, `action_flag`, `change_message`, `content_type_id`, `user_id`) VALUES + (1, '2020-07-15 21:17:11.320125', '2', 'bossanyiz', 1, '[{"added": {}}]', 6, 1), + (2, '2020-07-15 21:18:14.459237', '2', 'bossanyiz', 2, '[{"changed": {"fields": ["Staff status", "User permissions"]}}]', 6, 1), + (3, '2020-07-15 21:18:34.536886', '1', 'bossanyit', 2, '[]', 6, 1), + (4, '2020-07-17 12:55:10.730810', '42', 'BMI', 2, '[{"added": {"name": "Translation", "object": "Testt\\u00f6megindex"}}]', 1, 1), + (5, '2020-07-17 12:56:30.131977', '42', 'BMI', 2, '[{"changed": {"fields": ["Unit quantity", "Active"]}}, {"added": {"name": "Image", "object": "Menu"}}]', 1, 1), + (6, '2020-07-17 13:00:13.155087', '33', 'Pushups', 2, '[{"added": {"name": "Translation", "object": "Fekv\\u0151t\\u00e1masz"}}]', 1, 1), + (7, '2020-07-17 13:00:56.694138', '33', 'Pushups', 2, '[{"changed": {"name": "Translation", "object": "Fekv\\u0151t\\u00e1masz", "fields": ["Description"]}}]', 1, 1), + (8, '2020-07-17 13:04:00.555249', '33', 'Pushups', 2, '[{"added": {"name": "Translation", "object": "Pushups"}}]', 1, 1), + (9, '2020-07-17 13:04:55.391839', '33', 'Pushups', 2, '[{"added": {"name": "Image", "object": "Menu"}}]', 1, 1), + (10, '2020-07-17 13:14:55.082558', '43', 'BMR', 2, '[{"added": {"name": "Image", "object": "Menu"}}]', 1, 1), + (11, '2020-07-17 13:17:13.613844', '43', 'BMR', 2, '[{"added": {"name": "Translation", "object": "Anyagcsere"}}]', 1, 1), + (12, '2020-07-17 13:23:02.103075', '42', 'BMI', 2, '[{"added": {"name": "Image", "object": "Menu"}}]', 1, 1), + (13, '2020-07-17 13:28:39.416365', '42', 'BMI', 2, '[{"changed": {"name": "Image", "object": "Menu", "fields": ["Url"]}}]', 1, 1), + (14, '2020-07-17 13:32:53.260371', '42', 'BMI', 2, '[{"changed": {"name": "Image", "object": "Menu", "fields": ["Url"]}}]', 1, 1), + (15, '2020-07-17 13:35:10.444073', '42', 'BMI', 2, '[{"changed": {"name": "Image", "object": "Menu", "fields": ["Url"]}}]', 1, 1), + (16, '2020-07-17 14:25:35.777732', '37', 'Chest Press', 2, '[{"changed": {"fields": ["Active"]}}, {"added": {"name": "Translation", "object": "Fekvenyom\\u00e1s"}}]', 1, 1), + (17, '2020-07-17 14:25:59.786436', '37', 'Chest Press', 2, '[{"added": {"name": "Image", "object": "Menu"}}]', 1, 1), + (18, '2020-07-17 18:01:28.203874', '39', 'Biceps', 2, '[{"added": {"name": "Image", "object": "Menu"}}]', 1, 1), + (19, '2020-07-17 18:01:38.448709', '39', 'Biceps', 2, '[{"changed": {"fields": ["Active"]}}]', 1, 1), + (20, '2020-07-18 04:32:45.697604', '40', 'Triceps', 2, '[{"changed": {"fields": ["Unit quantity unit", "Active"]}}]', 1, 1), + (21, '2020-07-18 04:33:08.771752', '41', 'Shoulders', 2, '[{"changed": {"fields": ["Unit quantity unit"]}}]', 1, 1), + (22, '2020-07-18 14:21:54.906796', '39', 'Biceps', 2, '[{"changed": {"fields": ["Unit quantity unit"]}}, {"changed": {"name": "Image", "object": "Menu", "fields": ["Url"]}}]', 1, 1), + (23, '2020-07-18 14:22:13.106537', '39', 'Biceps', 2, '[{"changed": {"fields": ["Unit quantity unit"]}}, {"added": {"name": "Translation", "object": "Bicepsz"}}]', 1, 1), + (24, '2020-07-18 14:54:49.675512', '3', 'Cardió', 1, '[{"added": {}}, {"added": {"name": "Translation", "object": "Kardi\\u00f3"}}]', 10, 1), + (25, '2020-07-18 15:04:39.366770', '4', 'Strength', 1, '[{"added": {}}, {"added": {"name": "Translation", "object": "Er\\u0151"}}]', 10, 1), + (26, '2020-07-18 15:05:08.178394', '4', 'Strength', 2, '[{"changed": {"fields": ["Active"]}}]', 10, 1), + (27, '2020-07-18 20:13:49.098382', '42', 'BMI', 2, '[{"changed": {"fields": ["Tree"]}}]', 1, 1), + (28, '2020-07-18 20:14:32.671782', '5', 'Body Compositions', 1, '[{"added": {}}]', 10, 1), + (29, '2020-07-18 20:14:58.058983', '42', 'BMI', 2, '[{"changed": {"fields": ["Tree"]}}, {"changed": {"name": "Image", "object": "Menu", "fields": ["Url"]}}]', 1, 1), + (30, '2020-07-22 10:46:09.680783', '40', 'Triceps', 2, '[{"changed": {"fields": ["Tree"]}}, {"added": {"name": "Image", "object": "menu"}}]', 1, 1), + (31, '2020-07-22 10:47:27.086309', '40', 'Triceps', 2, '[{"added": {"name": "Image", "object": "k\\u00e9p1"}}]', 1, 1), + (32, '2020-07-22 11:01:56.535220', '40', 'Triceps', 2, '[]', 1, 1), + (33, '2020-07-22 11:02:37.684081', '40', 'Triceps', 2, '[{"added": {"name": "Translation", "object": "Tricepsz"}}]', 1, 1), + (34, '2020-07-23 21:14:59.508965', '3', 'Common', 1, '[{"added": {}}]', 11, 1), + (35, '2020-07-23 21:16:32.771314', '3', 'Common', 2, '[{"added": {"name": "Translation", "object": "\\u00c1ltal\\u00e1nos"}}]', 11, 1), + (36, '2020-07-23 21:40:29.189370', '1', 'ExercisePlanDetail object (1)', 1, '[{"added": {}}]', 12, 1), + (37, '2020-07-24 08:53:33.702668', '2', 'ExercisePlanDetail object (2)', 1, '[{"added": {}}]', 12, 1), + (38, '2020-07-24 12:22:12.728202', '4', 'Chack Norris Plan', 1, '[{"added": {}}, {"added": {"name": "Translation", "object": "Chuck Norris"}}]', 11, 1), + (39, '2020-07-24 12:23:12.143375', '3', 'ExercisePlanDetail object (3)', 1, '[{"added": {}}]', 12, 1), + (40, '2020-07-24 12:23:27.804811', '3', 'ExercisePlanDetail object (3)', 2, '[{"changed": {"fields": ["Weight equation"]}}]', 12, 1), + (41, '2020-07-24 12:24:59.169746', '40', 'Triceps', 2, '[{"changed": {"fields": ["Description"]}}, {"deleted": {"name": "Image", "object": "k\\u00e9p1"}}]', 1, 1), + (42, '2020-07-24 12:34:48.872571', '4', 'Chuck Norris Plan', 2, '[{"changed": {"fields": ["Name"]}}]', 11, 1), + (43, '2020-08-02 15:08:55.971818', '38', 'Pull Ups', 2, '[{"changed": {"fields": ["Tree"]}}]', 1, 1), + (44, '2020-08-02 15:09:03.864377', '38', 'Pull Ups', 2, '[{"changed": {"fields": ["Active"]}}]', 1, 1), + (45, '2020-08-12 11:53:25.856507', '6', '1RM', 1, '[{"added": {}}, {"added": {"name": "Translation", "object": "1RM"}}]', 10, 1), + (46, '2020-08-12 11:58:12.248347', '63', 'Chest Press', 1, '[{"added": {}}]', 1, 1), + (47, '2020-08-12 11:58:27.318080', '63', 'Chest Press', 2, '[{"changed": {"fields": ["Active"]}}]', 1, 1), + (48, '2020-08-19 07:18:57.669013', '63', 'Chest Press', 2, '[{"changed": {"fields": ["Base"]}}]', 1, 1), + (49, '2020-08-19 07:19:18.497845', '40', 'Triceps', 2, '[{"changed": {"fields": ["Unit quantity unit", "Base"]}}]', 1, 1), + (50, '2020-11-04 06:39:01.612172', '1', 'Subscription A', 1, '[{"added": {}}]', 13, 1), + (51, '2020-11-04 06:39:10.157077', '1', 'Subscription A', 2, '[]', 13, 1), + (52, '2020-11-04 06:39:23.636798', '2', 'Subscription B', 1, '[{"added": {}}]', 13, 1), + (53, '2020-11-04 06:39:42.076825', '3', 'Subscription C', 1, '[{"added": {}}]', 13, 1), + (54, '2020-11-04 06:39:58.226949', '4', 'Subscription D', 1, '[{"added": {}}]', 13, 1), + (55, '2020-11-04 06:40:11.278421', '5', 'Subscription E', 1, '[{"added": {}}]', 13, 1), + (56, '2020-11-04 06:40:25.885161', '6', 'Subscription F', 1, '[{"added": {}}]', 13, 1), + (57, '2020-11-04 06:40:56.370031', '7', 'Subscription A Yearly', 1, '[{"added": {}}]', 13, 1), + (58, '2020-11-04 06:49:24.492182', '1', 'CustomerProduct object (1)', 1, '[{"added": {}}]', 14, 1), + (59, '2020-11-09 14:21:30.881272', '3', 'chest', 2, '[{"added": {"name": "Translation", "object": "Mellsz\\u00e9less\\u00e9g"}}]', 16, 1), + (60, '2020-11-09 14:21:40.985999', '3', 'Chest', 2, '[{"changed": {"fields": ["Property name"]}}]', 16, 1), + (61, '2020-11-09 14:23:21.662825', '2', 'Height', 2, '[{"changed": {"fields": ["Property name"]}}]', 16, 1), + (62, '2020-11-09 14:23:26.715150', '1', 'weight', 2, '[]', 16, 1), + (63, '2020-11-09 14:23:37.635642', '1', 'Weight', 2, '[{"changed": {"fields": ["Property name"]}}]', 16, 1), + (64, '2020-11-09 14:24:02.841055', '4', 'Biceps', 1, '[{"added": {}}, {"added": {"name": "Translation", "object": "Bicepsz"}}]', 16, 1), + (65, '2020-11-19 19:51:12.121545', '2', 'Own Weight', 2, '[]', 17, 1), + (66, '2020-11-19 19:51:25.731297', '1', 'Weight', 2, '[]', 17, 1), + (67, '2020-11-19 19:51:40.056739', '3', 'Machine', 1, '[{"added": {}}, {"added": {"name": "Translation", "object": "Edz\\u0151termi g\\u00e9p"}}]', 17, 1), + (68, '2020-11-19 19:54:01.497189', '38', 'Pull Ups', 2, '[{"added": {"name": "Exercise Device", "object": "ExerciseTypeDevice object (2)"}}, {"added": {"name": "Exercise Device", "object": "ExerciseTypeDevice object (3)"}}]', 1, 1), + (69, '2020-11-24 11:43:58.417158', '3', 'Machine', 2, '[{"changed": {"fields": ["Image url"]}}]', 17, 1); +/*!40000 ALTER TABLE `django_admin_log` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. django_content_type +CREATE TABLE IF NOT EXISTS `django_content_type` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `app_label` varchar(100) COLLATE utf8_hungarian_ci NOT NULL, + `model` varchar(100) COLLATE utf8_hungarian_ci NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `django_content_type_app_label_model_76bd3d3b_uniq` (`app_label`,`model`) +) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci; + +-- Tábla adatainak mentése aitrainer2.django_content_type: ~16 rows (hozzávetőleg) +/*!40000 ALTER TABLE `django_content_type` DISABLE KEYS */; +REPLACE INTO `django_content_type` (`id`, `app_label`, `model`) VALUES + (3, 'admin', 'logentry'), + (14, 'aitrainer_backoffice', 'customerproduct'), + (17, 'aitrainer_backoffice', 'exercisedevice'), + (11, 'aitrainer_backoffice', 'exerciseplan'), + (12, 'aitrainer_backoffice', 'exerciseplandetail'), + (10, 'aitrainer_backoffice', 'exercisetree'), + (1, 'aitrainer_backoffice', 'exercisetype'), + (2, 'aitrainer_backoffice', 'exercisetypeimage'), + (9, 'aitrainer_backoffice', 'exercisetypetranslation'), + (13, 'aitrainer_backoffice', 'product'), + (16, 'aitrainer_backoffice', 'property'), + (15, 'aitrainer_backoffice', 'purchase'), + (5, 'auth', 'group'), + (4, 'auth', 'permission'), + (6, 'auth', 'user'), + (7, 'contenttypes', 'contenttype'), + (8, 'sessions', 'session'); +/*!40000 ALTER TABLE `django_content_type` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. django_migrations +CREATE TABLE IF NOT EXISTS `django_migrations` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `app` varchar(255) COLLATE utf8_hungarian_ci NOT NULL, + `name` varchar(255) COLLATE utf8_hungarian_ci NOT NULL, + `applied` datetime(6) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci; + +-- Tábla adatainak mentése aitrainer2.django_migrations: ~17 rows (hozzávetőleg) +/*!40000 ALTER TABLE `django_migrations` DISABLE KEYS */; +REPLACE INTO `django_migrations` (`id`, `app`, `name`, `applied`) VALUES + (1, 'contenttypes', '0001_initial', '2020-07-15 20:37:56.322447'), + (2, 'auth', '0001_initial', '2020-07-15 20:37:56.612931'), + (3, 'admin', '0001_initial', '2020-07-15 20:37:57.660438'), + (4, 'admin', '0002_logentry_remove_auto_add', '2020-07-15 20:37:57.931601'), + (5, 'admin', '0003_logentry_add_action_flag_choices', '2020-07-15 20:37:57.940565'), + (6, 'contenttypes', '0002_remove_content_type_name', '2020-07-15 20:37:58.057583'), + (7, 'auth', '0002_alter_permission_name_max_length', '2020-07-15 20:37:58.149674'), + (8, 'auth', '0003_alter_user_email_max_length', '2020-07-15 20:37:58.251147'), + (9, 'auth', '0004_alter_user_username_opts', '2020-07-15 20:37:58.266340'), + (10, 'auth', '0005_alter_user_last_login_null', '2020-07-15 20:37:58.344090'), + (11, 'auth', '0006_require_contenttypes_0002', '2020-07-15 20:37:58.354032'), + (12, 'auth', '0007_alter_validators_add_error_messages', '2020-07-15 20:37:58.367727'), + (13, 'auth', '0008_alter_user_username_max_length', '2020-07-15 20:37:58.386344'), + (14, 'auth', '0009_alter_user_last_name_max_length', '2020-07-15 20:37:58.405310'), + (15, 'auth', '0010_alter_group_name_max_length', '2020-07-15 20:37:58.506876'), + (16, 'auth', '0011_update_proxy_permissions', '2020-07-15 20:37:58.525870'), + (17, 'sessions', '0001_initial', '2020-07-15 20:37:58.638091'); +/*!40000 ALTER TABLE `django_migrations` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. django_session +CREATE TABLE IF NOT EXISTS `django_session` ( + `session_key` varchar(40) COLLATE utf8_hungarian_ci NOT NULL, + `session_data` longtext COLLATE utf8_hungarian_ci NOT NULL, + `expire_date` datetime(6) NOT NULL, + PRIMARY KEY (`session_key`), + KEY `django_session_expire_date_a5c62663` (`expire_date`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci; + +-- Tábla adatainak mentése aitrainer2.django_session: ~6 rows (hozzávetőleg) +/*!40000 ALTER TABLE `django_session` DISABLE KEYS */; +REPLACE INTO `django_session` (`session_key`, `session_data`, `expire_date`) VALUES + ('6oeeoxy9mt0kdbjgmvhl74qeqpefxaox', 'OWQ2YmUzOGUyZjA1MmRmNDFhYjU5MDQ3ODMzZmNkZWZkYjQ2MjA2MDp7Il9hdXRoX3VzZXJfaWQiOiIxIiwiX2F1dGhfdXNlcl9iYWNrZW5kIjoiZGphbmdvLmNvbnRyaWIuYXV0aC5iYWNrZW5kcy5Nb2RlbEJhY2tlbmQiLCJfYXV0aF91c2VyX2hhc2giOiJmM2ZiZmYzNWVjOTljMWEwZjk3OTg2MjM3Nzg4MGY5M2I0MDY5OGI0In0=', '2020-07-29 20:45:32.410329'), + ('j85p9jioio21gkg781wlih3ai1p8wrwv', 'OWFmMzBlYmEzMzE4YWZhMzQyYzY2ZDljNmMxZmFmNWJkMTZlN2Q5Yjp7Il9hdXRoX3VzZXJfaWQiOiIxIiwiX2F1dGhfdXNlcl9iYWNrZW5kIjoiZGphbmdvLmNvbnRyaWIuYXV0aC5iYWNrZW5kcy5Nb2RlbEJhY2tlbmQiLCJfYXV0aF91c2VyX2hhc2giOiI4M2ExMzllOTNmZDVlYmI4ODE1NWZkZWZjMjg3NWQ2NTAxNzJmNzNjIn0=', '2020-12-03 19:36:52.014607'), + ('job30dq18a2wr4upc589m348alh30yh2', 'OWFmMzBlYmEzMzE4YWZhMzQyYzY2ZDljNmMxZmFmNWJkMTZlN2Q5Yjp7Il9hdXRoX3VzZXJfaWQiOiIxIiwiX2F1dGhfdXNlcl9iYWNrZW5kIjoiZGphbmdvLmNvbnRyaWIuYXV0aC5iYWNrZW5kcy5Nb2RlbEJhY2tlbmQiLCJfYXV0aF91c2VyX2hhc2giOiI4M2ExMzllOTNmZDVlYmI4ODE1NWZkZWZjMjg3NWQ2NTAxNzJmNzNjIn0=', '2020-08-01 14:20:28.190449'), + ('q016xqrxq3sxlr4j4cl1qoxq9kr648rv', 'OWFmMzBlYmEzMzE4YWZhMzQyYzY2ZDljNmMxZmFmNWJkMTZlN2Q5Yjp7Il9hdXRoX3VzZXJfaWQiOiIxIiwiX2F1dGhfdXNlcl9iYWNrZW5kIjoiZGphbmdvLmNvbnRyaWIuYXV0aC5iYWNrZW5kcy5Nb2RlbEJhY2tlbmQiLCJfYXV0aF91c2VyX2hhc2giOiI4M2ExMzllOTNmZDVlYmI4ODE1NWZkZWZjMjg3NWQ2NTAxNzJmNzNjIn0=', '2020-09-02 07:18:27.193037'), + ('qdpx64cx2773smyq1gr9fu3djm7ewhcs', 'OWFmMzBlYmEzMzE4YWZhMzQyYzY2ZDljNmMxZmFmNWJkMTZlN2Q5Yjp7Il9hdXRoX3VzZXJfaWQiOiIxIiwiX2F1dGhfdXNlcl9iYWNrZW5kIjoiZGphbmdvLmNvbnRyaWIuYXV0aC5iYWNrZW5kcy5Nb2RlbEJhY2tlbmQiLCJfYXV0aF91c2VyX2hhc2giOiI4M2ExMzllOTNmZDVlYmI4ODE1NWZkZWZjMjg3NWQ2NTAxNzJmNzNjIn0=', '2020-08-16 15:08:37.232059'), + ('zwofo82y064pwz0x13qzq40bhn2gcg5d', 'OWFmMzBlYmEzMzE4YWZhMzQyYzY2ZDljNmMxZmFmNWJkMTZlN2Q5Yjp7Il9hdXRoX3VzZXJfaWQiOiIxIiwiX2F1dGhfdXNlcl9iYWNrZW5kIjoiZGphbmdvLmNvbnRyaWIuYXV0aC5iYWNrZW5kcy5Nb2RlbEJhY2tlbmQiLCJfYXV0aF91c2VyX2hhc2giOiI4M2ExMzllOTNmZDVlYmI4ODE1NWZkZWZjMjg3NWQ2NTAxNzJmNzNjIn0=', '2020-11-18 06:31:44.669865'); +/*!40000 ALTER TABLE `django_session` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. 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', + `exercise_plan_detail_id` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`exercise_id`), + KEY `exercise_type_id` (`exercise_type_id`), + KEY `customer_id` (`customer_id`) +) ENGINE=InnoDB AUTO_INCREMENT=167 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci; + +-- Tábla adatainak mentése aitrainer2.exercises: ~4 rows (hozzávetőleg) +/*!40000 ALTER TABLE `exercises` DISABLE KEYS */; +REPLACE INTO `exercises` (`exercise_id`, `exercise_type_id`, `customer_id`, `date_add`, `quantity`, `unit`, `unit_quantity`, `rest_time`, `exercise_plan_detail_id`) VALUES + (1, 1, 1, '2020-05-01 00:00:00', 12.2, 'repeat', NULL, NULL, 0), + (2, 3, 11, '2020-05-13 04:32:00', 100, 'repeat', 30, NULL, 0), + (69, 2, 1, '2020-05-14 03:43:45', 30, 'repeat', 12, NULL, 0), + (70, 2, 1, '2020-04-04 03:43:45', 50, 'repeat', 40, NULL, 0); +/*!40000 ALTER TABLE `exercises` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. exercise_device +CREATE TABLE IF NOT EXISTS `exercise_device` ( + `exercise_device_id` int(11) NOT NULL AUTO_INCREMENT, + `name` char(50) COLLATE utf8_hungarian_ci DEFAULT NULL, + `description` varchar(200) COLLATE utf8_hungarian_ci DEFAULT NULL, + `image_url` char(100) COLLATE utf8_hungarian_ci DEFAULT NULL, + `sort` int(11) DEFAULT 0, + `place` tinyint(4) DEFAULT 0, + PRIMARY KEY (`exercise_device_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci; + +-- Tábla adatainak mentése aitrainer2.exercise_device: ~2 rows (hozzávetőleg) +/*!40000 ALTER TABLE `exercise_device` DISABLE KEYS */; +REPLACE INTO `exercise_device` (`exercise_device_id`, `name`, `description`, `image_url`, `sort`, `place`) VALUES + (1, 'Weight', NULL, NULL, 5, 0), + (2, 'Own Weight', NULL, NULL, 4, 0), + (3, 'Machine', '', 'images/csengo2.png', 3, 0), + (4, 'HOME', NULL, NULL, 1, 1), + (5, 'STREET', NULL, NULL, 2, 1); +/*!40000 ALTER TABLE `exercise_device` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. exercise_device_translation +CREATE TABLE IF NOT EXISTS `exercise_device_translation` ( + `translation_id` int(11) NOT NULL AUTO_INCREMENT, + `exercise_device_id` int(11) DEFAULT NULL, + `language_code` char(2) COLLATE utf8_hungarian_ci DEFAULT NULL, + `name` char(100) COLLATE utf8_hungarian_ci DEFAULT NULL, + PRIMARY KEY (`translation_id`) USING BTREE, + KEY `exercise_device_id` (`exercise_device_id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci; + +-- Tábla adatainak mentése aitrainer2.exercise_device_translation: ~3 rows (hozzávetőleg) +/*!40000 ALTER TABLE `exercise_device_translation` DISABLE KEYS */; +REPLACE INTO `exercise_device_translation` (`translation_id`, `exercise_device_id`, `language_code`, `name`) VALUES + (1, 1, 'hu', 'Súlyzó'), + (2, 2, 'hu', 'Saját testsúly'), + (3, 3, 'hu', 'Edzőtermi gép'); +/*!40000 ALTER TABLE `exercise_device_translation` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. exercise_plan +CREATE TABLE IF NOT EXISTS `exercise_plan` ( + `exercise_plan_id` int(11) NOT NULL AUTO_INCREMENT, + `customer_id` int(11) NOT NULL DEFAULT 0, + `name` char(50) DEFAULT '0', + `description` text DEFAULT NULL, + `private` tinyint(4) DEFAULT 0, + `date_add` datetime DEFAULT NULL, + `date_upd` datetime DEFAULT NULL, + PRIMARY KEY (`exercise_plan_id`) +) ENGINE=InnoDB AUTO_INCREMENT=104 DEFAULT CHARSET=utf8mb4; + +-- Tábla adatainak mentése aitrainer2.exercise_plan: ~4 rows (hozzávetőleg) +/*!40000 ALTER TABLE `exercise_plan` DISABLE KEYS */; +REPLACE 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), + (4, 90, 'Chuck Norris Plan', '', 0, NULL, NULL), + (6, 90, 'Boss private', '', 1, '2020-09-08 00:06:26', NULL), + (20, 90, 'Boss private 2', NULL, 1, '2020-09-09 00:06:19', NULL); +/*!40000 ALTER TABLE `exercise_plan` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. exercise_plan_detail +CREATE TABLE IF NOT EXISTS `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) DEFAULT NULL, + `weight_equation` char(50) DEFAULT NULL, + PRIMARY KEY (`exercise_plan_detail_id`) +) ENGINE=InnoDB AUTO_INCREMENT=116 DEFAULT CHARSET=utf8mb4; + +-- Tábla adatainak mentése aitrainer2.exercise_plan_detail: ~5 rows (hozzávetőleg) +/*!40000 ALTER TABLE `exercise_plan_detail` DISABLE KEYS */; +REPLACE 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%'), + (2, 3, 36, 3, 50, '75%'), + (3, 4, 37, 3, 12, '85%'), + (4, 6, 39, 3, 1, '40'), + (5, 6, 40, 12, 3, '40'); +/*!40000 ALTER TABLE `exercise_plan_detail` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. exercise_plan_translation +CREATE TABLE IF NOT EXISTS `exercise_plan_translation` ( + `translation_id` int(11) NOT NULL AUTO_INCREMENT, + `language_code` char(2) NOT NULL DEFAULT '0', + `name` char(50) DEFAULT '0', + `description` text DEFAULT NULL, + `exercise_plan_id` int(11) DEFAULT NULL, + PRIMARY KEY (`translation_id`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4; + +-- Tábla adatainak mentése aitrainer2.exercise_plan_translation: ~2 rows (hozzávetőleg) +/*!40000 ALTER TABLE `exercise_plan_translation` DISABLE KEYS */; +REPLACE INTO `exercise_plan_translation` (`translation_id`, `language_code`, `name`, `description`, `exercise_plan_id`) VALUES + (1, 'hu', 'Általános', 'Általános edzésterv', 3), + (2, 'hu', 'Chuck Norris', '', 4); +/*!40000 ALTER TABLE `exercise_plan_translation` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. exercise_tree +CREATE TABLE IF NOT EXISTS `exercise_tree` ( + `tree_id` int(11) NOT NULL AUTO_INCREMENT, + `parent_id` int(11) NOT NULL DEFAULT 0, + `name` char(50) DEFAULT NULL, + `image_url` char(200) DEFAULT NULL, + `active` tinyint(1) DEFAULT 1, + PRIMARY KEY (`tree_id`) USING BTREE, + KEY `parent_id` (`parent_id`) +) 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 */; +INSERT 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 */; + +-- Struktúra mentése tábla aitrainer2. exercise_tree_translation +DROP TABLE IF EXISTS `exercise_tree_translation`; +CREATE TABLE IF NOT EXISTS `exercise_tree_translation` ( + `translation_id` int(13) NOT NULL AUTO_INCREMENT, + `tree_id` int(13) NOT NULL DEFAULT 0, + `language_code` char(2) DEFAULT NULL, + `name` char(100) DEFAULT NULL, + PRIMARY KEY (`translation_id`), + KEY `tree_id` (`tree_id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4; + +-- 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'); +/*!40000 ALTER TABLE `exercise_tree_translation` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. exercise_type +CREATE TABLE IF NOT EXISTS `exercise_type` ( + `exercise_type_id` int(11) NOT NULL AUTO_INCREMENT, + `tree_id` int(11) NOT NULL, + `name` char(100) COLLATE utf8_hungarian_ci NOT NULL, + `description` varchar(1000) COLLATE utf8_hungarian_ci DEFAULT NULL, + `unit` char(50) COLLATE utf8_hungarian_ci DEFAULT NULL, + `unit_quantity` tinyint(4) DEFAULT NULL, + `unit_quantity_unit` char(50) COLLATE utf8_hungarian_ci DEFAULT NULL, + `active` tinyint(1) DEFAULT 1, + `base` tinyint(1) DEFAULT 0, + PRIMARY KEY (`exercise_type_id`) USING BTREE, + KEY `tree_id` (`tree_id`) +) ENGINE=InnoDB AUTO_INCREMENT=118 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci; + +-- Tábla adatainak mentése aitrainer2.exercise_type: ~26 rows (hozzávetőleg) +/*!40000 ALTER TABLE `exercise_type` DISABLE KEYS */; +REPLACE 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), + (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), + (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), + (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), + (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), + (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), + (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), + (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), + (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), + (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), + (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), + (30, 0, 'Cooper', '12 minutes run, how many meters', 'meter', NULL, NULL, NULL, 0), + (31, 0, '300m', NULL, 'second', NULL, NULL, NULL, 0), + (32, 0, '400m', NULL, 'second', NULL, NULL, NULL, 0), + (33, 0, 'Pushups', '', 'repeat', NULL, NULL, NULL, 0), + (34, 0, 'Timed Pushups', NULL, 'repeat', 1, 'second', NULL, 0), + (35, 0, 'Squats', NULL, 'repeat', 1, 'kg', NULL, 0), + (36, 0, 'Sit-ups', NULL, 'repeat', NULL, NULL, NULL, 0), + (37, 0, 'Chest Press', '', 'repeat', 1, 'kg', 1, 0), + (38, 4, 'Pull Ups', '', 'repeat', NULL, NULL, 1, 0), + (39, 0, 'Biceps', '', 'repeat', 1, 'kg', 1, 0), + (40, 4, 'Triceps', 'Triceps', 'repeat', 1, NULL, 1, 1), + (41, 0, 'Shoulders', '', 'repeat', 1, 'kg', 1, 0), + (42, 5, 'BMI', '', 'percent', 0, NULL, 1, 0), + (43, 0, 'BMR', '', 'calorie', NULL, NULL, NULL, 0), + (63, 4, 'Chest Press', '', 'repeat', 0, 'kilogram', 1, 1); +/*!40000 ALTER TABLE `exercise_type` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. exercise_type_device +CREATE TABLE IF NOT EXISTS `exercise_type_device` ( + `exercise_type_device_id` int(11) NOT NULL AUTO_INCREMENT, + `exercise_type_id` int(11) NOT NULL DEFAULT 0, + `exercise_device_id` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`exercise_type_device_id`) USING BTREE, + KEY `exercise_type_id` (`exercise_type_id`) USING BTREE, + KEY `device_id` (`exercise_device_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci; + +-- Tábla adatainak mentése aitrainer2.exercise_type_device: ~3 rows (hozzávetőleg) +/*!40000 ALTER TABLE `exercise_type_device` DISABLE KEYS */; +REPLACE INTO `exercise_type_device` (`exercise_type_device_id`, `exercise_type_id`, `exercise_device_id`) VALUES + (1, 37, 1), + (2, 38, 1), + (3, 38, 3); +/*!40000 ALTER TABLE `exercise_type_device` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. exercise_type_image +CREATE TABLE IF NOT EXISTS `exercise_type_image` ( + `image_id` int(13) NOT NULL AUTO_INCREMENT, + `exercise_type_id` int(13) DEFAULT 0, + `name` char(50) DEFAULT NULL, + `type` enum('menu','image','video') DEFAULT 'image', + `url` char(200) DEFAULT NULL, + PRIMARY KEY (`image_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4; + +-- Tábla adatainak mentése aitrainer2.exercise_type_image: ~5 rows (hozzávetőleg) +/*!40000 ALTER TABLE `exercise_type_image` DISABLE KEYS */; +REPLACE INTO `exercise_type_image` (`image_id`, `exercise_type_id`, `name`, `type`, `url`) VALUES + (3, 43, 'Menu', 'menu', '3.2.BMR.png'), + (4, 42, 'Menu', 'menu', 'images/3.1.BMI.png'), + (5, 37, 'Menu', 'menu', 'images/2.2.1.1.chestpress.png'), + (6, 39, 'Menu', 'menu', 'images/2.2.1.3.biceps.png'), + (7, 40, 'menu', 'menu', 'images/2.2.1.4.triceps.png'); +/*!40000 ALTER TABLE `exercise_type_image` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. exercise_type_translation +CREATE TABLE IF NOT EXISTS `exercise_type_translation` ( + `translation_id` int(13) NOT NULL AUTO_INCREMENT, + `language_code` char(2) NOT NULL DEFAULT 'en', + `exercise_type_id` int(13) NOT NULL DEFAULT 0, + `name` char(50) DEFAULT NULL, + `description` mediumtext DEFAULT NULL, + PRIMARY KEY (`translation_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4; + +-- Tábla adatainak mentése aitrainer2.exercise_type_translation: ~7 rows (hozzávetőleg) +/*!40000 ALTER TABLE `exercise_type_translation` DISABLE KEYS */; +REPLACE INTO `exercise_type_translation` (`translation_id`, `language_code`, `exercise_type_id`, `name`, `description`) VALUES + (1, 'hu', 42, 'Testtömegindex', NULL), + (2, 'hu', 33, 'Fekvőtámasz', 'fekvőtámasz'), + (3, 'en', 33, 'Pushups', 'pushup'), + (4, 'hu', 43, 'Anyagcsere', ''), + (5, 'hu', 37, 'Fekvenyomás', ''), + (6, 'hu', 39, 'Bicepsz', ''), + (7, 'hu', 40, 'Tricepsz', 'Tricepsz leírás'); +/*!40000 ALTER TABLE `exercise_type_translation` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. product +CREATE TABLE IF NOT EXISTS `product` ( + `product_id` int(11) NOT NULL AUTO_INCREMENT, + `name` char(50) NOT NULL, + `description` mediumtext DEFAULT NULL, + `type` enum('subscription','in-app-currency') NOT NULL DEFAULT 'subscription', + `valid_from` date DEFAULT NULL, + `valid_to` date DEFAULT NULL, + PRIMARY KEY (`product_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4; + +-- Tábla adatainak mentése aitrainer2.product: ~12 rows (hozzávetőleg) +/*!40000 ALTER TABLE `product` DISABLE KEYS */; +REPLACE INTO `product` (`product_id`, `name`, `description`, `type`, `valid_from`, `valid_to`) VALUES + (1, 'Subscription A', '700 Ft', 'subscription', '2020-11-01', NULL), + (2, 'Subscription B', '1000 Ft', 'subscription', '2020-11-01', NULL), + (3, 'Subscription C', '1500 Ft', 'subscription', '2020-11-01', NULL), + (4, 'Subscription D', '2000 Ft', 'subscription', '2020-11-01', NULL), + (5, 'Subscription E', '3000 Ft', 'subscription', '2020-11-01', NULL), + (6, 'Subscription F', '5000 Ft', 'subscription', '2020-11-01', NULL), + (7, 'Subscription A Yearly', '7000 Ft', 'subscription', '2020-11-01', NULL), + (8, 'Subscription B Yearly', '10000', 'subscription', '2020-11-04', NULL), + (9, 'Subscription C Yearly', '15000', 'subscription', '2020-11-04', NULL), + (10, 'Subscription D Yearly', '20000', 'subscription', '2020-11-04', NULL), + (11, 'Subscription E Yearly', '30000', 'subscription', '2020-11-04', NULL), + (12, 'Subscription F Yearly', '50000', 'subscription', '2020-11-04', NULL); +/*!40000 ALTER TABLE `product` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. product_test +CREATE TABLE IF NOT EXISTS `product_test` ( + `product_test_id` int(11) NOT NULL AUTO_INCREMENT, + `product_id` int(11) DEFAULT 0, + `customer_id` int(11) DEFAULT 0, + `date_view` datetime DEFAULT NULL, + `purchase_click` tinyint(4) DEFAULT 0, + PRIMARY KEY (`product_test_id`) USING BTREE, + KEY `customer_id` (`customer_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb4; + +-- Tábla adatainak mentése aitrainer2.product_test: ~3 rows (hozzávetőleg) +/*!40000 ALTER TABLE `product_test` DISABLE KEYS */; +REPLACE INTO `product_test` (`product_test_id`, `product_id`, `customer_id`, `date_view`, `purchase_click`) VALUES + (4, 2, 62, '2020-10-01 12:00:00', 0), + (5, 2, 62, '2020-11-01 12:00:00', 0), + (8, 1, 1, '2020-11-01 07:07:02', 0); +/*!40000 ALTER TABLE `product_test` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. property +CREATE TABLE IF NOT EXISTS `property` ( + `property_id` int(11) NOT NULL AUTO_INCREMENT, + `property_name` char(50) COLLATE utf8_hungarian_ci DEFAULT NULL, + `property_unit` char(50) COLLATE utf8_hungarian_ci DEFAULT NULL, + PRIMARY KEY (`property_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci; + +-- Tábla adatainak mentése aitrainer2.property: ~4 rows (hozzávetőleg) +/*!40000 ALTER TABLE `property` DISABLE KEYS */; +REPLACE INTO `property` (`property_id`, `property_name`, `property_unit`) VALUES + (1, 'Weight', 'kg'), + (2, 'Height', 'cm'), + (3, 'Chest', 'cm'), + (4, 'Biceps', 'cm'); +/*!40000 ALTER TABLE `property` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. property_translation +CREATE TABLE IF NOT EXISTS `property_translation` ( + `translation_id` int(13) NOT NULL AUTO_INCREMENT, + `language_code` char(2) NOT NULL DEFAULT 'en', + `property_id` int(13) NOT NULL DEFAULT 0, + `property_name` char(50) DEFAULT NULL, + PRIMARY KEY (`translation_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; + +-- Tábla adatainak mentése aitrainer2.property_translation: ~0 rows (hozzávetőleg) +/*!40000 ALTER TABLE `property_translation` DISABLE KEYS */; +REPLACE INTO `property_translation` (`translation_id`, `language_code`, `property_id`, `property_name`) VALUES + (1, 'hu', 1, 'Tömeg'); +/*!40000 ALTER TABLE `property_translation` ENABLE KEYS */; + +-- Struktúra mentése tábla aitrainer2. purchase +CREATE TABLE IF NOT EXISTS `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 DEFAULT NULL, + `purchase_sum` double(22,0) DEFAULT NULL, + `currency` char(3) DEFAULT NULL, + PRIMARY KEY (`purchase_id`) USING BTREE, + KEY `customer_id` (`customer_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4; + +-- Tábla adatainak mentése aitrainer2.purchase: ~5 rows (hozzávetőleg) +/*!40000 ALTER TABLE `purchase` DISABLE KEYS */; +REPLACE 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'), + (2, 62, 1, '2020-11-05 15:45:08', 1000, 'HUF'), + (3, 2, 1, '2020-11-05 15:45:30', 1000, 'HUF'), + (6, 1, 2, '2020-11-05 12:00:00', 2000, 'HUF'), + (7, 1, 2, '2020-11-05 12:00:00', 2000, 'HUF'); +/*!40000 ALTER TABLE `purchase` 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 */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; diff --git a/pubspec.lock b/pubspec.lock index 82c2243..dd9d3ca 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -848,6 +848,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.5" + sqflite: + dependency: "direct main" + description: + name: sqflite + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.2+1" + sqflite_common: + dependency: transitive + description: + name: sqflite_common + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2+1" stack_trace: dependency: transitive description: @@ -883,6 +897,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.2.0" + synchronized: + dependency: transitive + description: + name: synchronized + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0+2" term_glyph: dependency: transitive description: @@ -1024,5 +1045,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" - flutter: ">=1.17.0 <2.0.0" + dart: ">=2.10.2 <2.11.0" + flutter: ">=1.22.2 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 4d0a6ae..0714bc9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -53,6 +53,7 @@ dependencies: animated_widgets: ^1.0.6 mockito: ^4.1.3 + sqflite: ^1.3.0 flutter_localizations: sdk: flutter diff --git a/test/widget_test.login.dart b/test/widget_test.login.dart index d5490db..ac7cbd9 100644 --- a/test/widget_test.login.dart +++ b/test/widget_test.login.dart @@ -5,8 +5,8 @@ // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the values of widget properties are correct. - import 'package:aitrainer_app/bloc/login_form_bloc.dart'; +import 'package:aitrainer_app/helper/database.dart'; import 'package:aitrainer_app/library_keys.dart'; import 'package:aitrainer_app/localization/app_localization.dart'; import 'package:aitrainer_app/model/user.dart'; @@ -20,8 +20,7 @@ import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; - -class MockUserRepository extends Mock implements UserRepository { +class MockUserRepository extends Mock implements UserRepository { final User user = User(); setEmail(String email) { @@ -33,15 +32,15 @@ class MockUserRepository extends Mock implements UserRepository { } Future getUser() async { - if ( this.user.email == "sw@andio.biz" && this.user.password == "PalKataPeter1") { + if (this.user.email == "sw@andio.biz" && this.user.password == "PalKataPeter1") { //OK } else { throw new Exception("Customer does not exist"); } } } -class MockLoginBloc extends MockBloc - implements LoginFormBloc {} + +class MockLoginBloc extends MockBloc implements LoginFormBloc {} class MockCommon with Common { String getEmailError() { @@ -55,22 +54,18 @@ void main() { Widget loginWidget; MockCommon common; - setUp(() { + setUp(() async { + await DB().initDb(); loginBloc = MockLoginBloc(); common = MockCommon(); - loginWidget = - MaterialApp( - home: LoginPage(), - localizationsDelegates: [ - AppLocalizationsDelegate(isTest: true), - GlobalMaterialLocalizations.delegate, - GlobalCupertinoLocalizations.delegate, - ], - routes: { - 'home': (context) => LoginPage(), - } - ); + loginWidget = MaterialApp(home: LoginPage(), localizationsDelegates: [ + AppLocalizationsDelegate(isTest: true), + GlobalMaterialLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + ], routes: { + 'home': (context) => LoginPage(), + }); }); tearDown(() { diff --git a/test_driver/app_test.dart b/test_driver/app_test.dart index d2b8990..1182791 100644 --- a/test_driver/app_test.dart +++ b/test_driver/app_test.dart @@ -1,8 +1,20 @@ // Imports the Flutter Driver API. +import 'package:flutter_driver/flutter_driver.dart'; import 'package:test/test.dart'; -void main() { - group('Login App', () { +import '../lib/helper/database.dart'; +void main() { + FlutterDriver driver; + group('Login App', () { + setUpAll(() async { + driver = await FlutterDriver.connect(); + await DB().initDb(); + }); + + tearDownAll(() async { + if (driver != null) driver.close(); + await DB().closeDb(); + }); }); -} \ No newline at end of file +} diff --git a/test_driver/service/customer_service.dart b/test_driver/service/customer_service.dart new file mode 100644 index 0000000..865ed0e --- /dev/null +++ b/test_driver/service/customer_service.dart @@ -0,0 +1,12 @@ +import 'dart:html'; + +import 'package:aitrainer_app/model/customer.dart'; +import 'package:flutter/material.dart'; +import '../../lib/helper/database.dart'; + +class CustomerApi { + Future addCustomer(Customer customer) async { + //print(" ===== add new customer: " + customer.toSQL().toString(); + await DB().getDB().insert("customer", customer.toJson()); + } +}