Browse Source

Final fixes

master
Apostolos Fanakis 6 years ago
parent
commit
e986668e10
  1. 6
      Database implementation/dumps/Project Folder/flavours_without_borders_diet.sql
  2. 4
      Database implementation/dumps/Project Folder/flavours_without_borders_diet_prohibits_ingredient.sql
  3. 6
      Database implementation/dumps/Project Folder/flavours_without_borders_drink.sql
  4. 4
      Database implementation/dumps/Project Folder/flavours_without_borders_drink_has_ingredient.sql
  5. 6
      Database implementation/dumps/Project Folder/flavours_without_borders_food.sql
  6. 4
      Database implementation/dumps/Project Folder/flavours_without_borders_food_has_ingredient.sql
  7. 4
      Database implementation/dumps/Project Folder/flavours_without_borders_ingredient.sql
  8. 4
      Database implementation/dumps/Project Folder/flavours_without_borders_permission.sql
  9. 4
      Database implementation/dumps/Project Folder/flavours_without_borders_restaurant.sql
  10. 6
      Database implementation/dumps/Project Folder/flavours_without_borders_role.sql
  11. 2
      Database implementation/dumps/Project Folder/flavours_without_borders_role_has_permission.sql
  12. 2
      Database implementation/dumps/Project Folder/flavours_without_borders_routines.sql
  13. 4
      Database implementation/dumps/Project Folder/flavours_without_borders_user.sql
  14. 2
      Database implementation/dumps/Project Folder/flavours_without_borders_user_follows_diet.sql
  15. 4
      Database implementation/dumps/Project Folder/flavours_without_borders_user_prohibits_ingredient.sql
  16. 4
      Database implementation/dumps/Project Folder/flavours_without_borders_user_rates_drink.sql
  17. 4
      Database implementation/dumps/Project Folder/flavours_without_borders_user_rates_food.sql
  18. 4
      Database implementation/dumps/Project Folder/flavours_without_borders_user_rates_restaurant.sql
  19. 40
      Database implementation/dumps/Self Contained/dump.sql
  20. BIN
      Database implementation/model/erd.png
  21. 4817
      Database implementation/model/erd.svg
  22. BIN
      Database implementation/model/model.mwb
  23. 7
      Database implementation/queries/query_12.sql
  24. 6
      Database implementation/queries/query_5.sql
  25. 5
      Database implementation/queries/query_6.sql

6
Database implementation/dumps/Project Folder/flavours_without_borders_diet.sql

@ -26,8 +26,8 @@ DROP TABLE IF EXISTS `diet`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `diet` (
`diet_id` int(11) NOT NULL,
`diet_name` varchar(200) NOT NULL,
`diet_description` varchar(350) DEFAULT NULL,
`diet_name` varchar(500) NOT NULL,
`diet_description` varchar(700) DEFAULT NULL,
`diet_is_approved` bit(1) DEFAULT b'0',
PRIMARY KEY (`diet_id`),
UNIQUE KEY `diet_id_UNIQUE` (`diet_id`)
@ -53,4 +53,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-12-22 19:43:57
-- Dump completed on 2018-12-23 18:53:52

4
Database implementation/dumps/Project Folder/flavours_without_borders_diet_prohibits_ingredient.sql

@ -26,7 +26,7 @@ DROP TABLE IF EXISTS `diet_prohibits_ingredient`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `diet_prohibits_ingredient` (
`diet_id` int(11) NOT NULL,
`ingredient_name` varchar(200) NOT NULL,
`ingredient_name` varchar(500) NOT NULL,
PRIMARY KEY (`diet_id`,`ingredient_name`),
KEY `diet_prohibits_ingredient_name_idx` (`ingredient_name`),
CONSTRAINT `diet_prohibits_has_diet_id` FOREIGN KEY (`diet_id`) REFERENCES `diet` (`diet_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
@ -53,4 +53,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-12-22 19:44:00
-- Dump completed on 2018-12-23 18:53:55

6
Database implementation/dumps/Project Folder/flavours_without_borders_drink.sql

@ -26,8 +26,8 @@ DROP TABLE IF EXISTS `drink`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `drink` (
`drink_id` int(11) NOT NULL,
`drink_name` varchar(200) NOT NULL,
`drink_description` varchar(150) DEFAULT NULL,
`drink_name` varchar(500) NOT NULL,
`drink_description` varchar(700) DEFAULT NULL,
`drink_has_alcohol` bit(1) NOT NULL,
`drink_is_approved` bit(1) DEFAULT b'0',
`restaurant_id` int(11) NOT NULL,
@ -57,4 +57,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-12-22 19:43:56
-- Dump completed on 2018-12-23 18:53:51

4
Database implementation/dumps/Project Folder/flavours_without_borders_drink_has_ingredient.sql

@ -26,7 +26,7 @@ DROP TABLE IF EXISTS `drink_has_ingredient`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `drink_has_ingredient` (
`drink_id` int(11) NOT NULL,
`ingredient_name` varchar(200) NOT NULL,
`ingredient_name` varchar(500) NOT NULL,
PRIMARY KEY (`drink_id`,`ingredient_name`),
KEY `ingredient_name_idx` (`ingredient_name`),
CONSTRAINT `drink_has_drink_id` FOREIGN KEY (`drink_id`) REFERENCES `drink` (`drink_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
@ -53,4 +53,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-12-22 19:43:54
-- Dump completed on 2018-12-23 18:53:49

6
Database implementation/dumps/Project Folder/flavours_without_borders_food.sql

@ -26,8 +26,8 @@ DROP TABLE IF EXISTS `food`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `food` (
`food_id` int(11) NOT NULL,
`food_name` varchar(200) NOT NULL,
`food_description` varchar(150) DEFAULT NULL,
`food_name` varchar(500) NOT NULL,
`food_description` varchar(700) DEFAULT NULL,
`food_calories` int(11) DEFAULT NULL,
`food_is_approved` bit(1) DEFAULT b'0',
`restaurant_id` int(11) NOT NULL,
@ -57,4 +57,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-12-22 19:43:55
-- Dump completed on 2018-12-23 18:53:50

4
Database implementation/dumps/Project Folder/flavours_without_borders_food_has_ingredient.sql

@ -26,7 +26,7 @@ DROP TABLE IF EXISTS `food_has_ingredient`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `food_has_ingredient` (
`food_id` int(11) NOT NULL,
`ingredient_name` varchar(200) NOT NULL,
`ingredient_name` varchar(500) NOT NULL,
PRIMARY KEY (`food_id`,`ingredient_name`),
KEY `ingredient_name_idx` (`ingredient_name`),
CONSTRAINT `food_has_food_id` FOREIGN KEY (`food_id`) REFERENCES `food` (`food_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
@ -53,4 +53,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-12-22 19:44:05
-- Dump completed on 2018-12-23 18:54:01

4
Database implementation/dumps/Project Folder/flavours_without_borders_ingredient.sql

@ -25,7 +25,7 @@ DROP TABLE IF EXISTS `ingredient`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ingredient` (
`ingredient_name` varchar(200) NOT NULL,
`ingredient_name` varchar(500) NOT NULL,
`ingredient_has_alcohol` bit(1) DEFAULT b'0',
PRIMARY KEY (`ingredient_name`),
UNIQUE KEY `ingredient_name_UNIQUE` (`ingredient_name`)
@ -51,4 +51,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-12-22 19:44:06
-- Dump completed on 2018-12-23 18:54:01

4
Database implementation/dumps/Project Folder/flavours_without_borders_permission.sql

@ -26,7 +26,7 @@ DROP TABLE IF EXISTS `permission`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `permission` (
`permission_id` int(11) NOT NULL,
`permission_description` varchar(45) NOT NULL,
`permission_description` varchar(700) NOT NULL,
PRIMARY KEY (`permission_id`),
UNIQUE KEY `permission_id_UNIQUE` (`permission_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -51,4 +51,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-12-22 19:43:54
-- Dump completed on 2018-12-23 18:53:49

4
Database implementation/dumps/Project Folder/flavours_without_borders_restaurant.sql

@ -26,7 +26,7 @@ DROP TABLE IF EXISTS `restaurant`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `restaurant` (
`restaurant_id` int(11) NOT NULL,
`restaurant_name` varchar(200) NOT NULL,
`restaurant_name` varchar(500) NOT NULL,
`restaurant_category` enum('cafeteria','pub','bar','restaurant','fast_food','ethnic') NOT NULL,
`restaurant_longitude` float NOT NULL,
`restaurant_latitude` float NOT NULL,
@ -60,4 +60,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-12-22 19:44:00
-- Dump completed on 2018-12-23 18:53:56

6
Database implementation/dumps/Project Folder/flavours_without_borders_role.sql

@ -26,8 +26,8 @@ DROP TABLE IF EXISTS `role`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `role` (
`role_id` int(11) NOT NULL,
`role_name` varchar(200) NOT NULL,
`role_description` varchar(150) NOT NULL,
`role_name` varchar(500) NOT NULL,
`role_description` varchar(700) NOT NULL,
PRIMARY KEY (`role_id`),
UNIQUE KEY `role_id_UNIQUE` (`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -52,4 +52,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-12-22 19:44:04
-- Dump completed on 2018-12-23 18:54:00

2
Database implementation/dumps/Project Folder/flavours_without_borders_role_has_permission.sql

@ -53,4 +53,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-12-22 19:44:04
-- Dump completed on 2018-12-23 18:53:59

2
Database implementation/dumps/Project Folder/flavours_without_borders_routines.sql

@ -118,4 +118,4 @@ SET character_set_client = @saved_cs_client;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-12-22 19:44:07
-- Dump completed on 2018-12-23 18:54:03

4
Database implementation/dumps/Project Folder/flavours_without_borders_user.sql

@ -27,7 +27,7 @@ DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`user_id` int(11) NOT NULL,
`user_email` varchar(500) NOT NULL,
`user_username` varchar(200) NOT NULL,
`user_username` varchar(500) NOT NULL,
`user_hashed_password` char(64) NOT NULL,
`user_salt` char(32) NOT NULL,
`role_id` int(11) NOT NULL,
@ -58,4 +58,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-12-22 19:43:58
-- Dump completed on 2018-12-23 18:53:54

2
Database implementation/dumps/Project Folder/flavours_without_borders_user_follows_diet.sql

@ -53,4 +53,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-12-22 19:44:02
-- Dump completed on 2018-12-23 18:53:58

4
Database implementation/dumps/Project Folder/flavours_without_borders_user_prohibits_ingredient.sql

@ -26,7 +26,7 @@ DROP TABLE IF EXISTS `user_prohibits_ingredient`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_prohibits_ingredient` (
`user_id` int(11) NOT NULL,
`ingredient_name` varchar(200) NOT NULL,
`ingredient_name` varchar(500) NOT NULL,
PRIMARY KEY (`user_id`,`ingredient_name`),
KEY `user_prohibits_ingredient_name_idx` (`ingredient_name`),
CONSTRAINT `user_prohibits_has_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
@ -53,4 +53,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-12-22 19:44:03
-- Dump completed on 2018-12-23 18:53:58

4
Database implementation/dumps/Project Folder/flavours_without_borders_user_rates_drink.sql

@ -29,7 +29,7 @@ CREATE TABLE `user_rates_drink` (
`drink_id` int(11) NOT NULL,
`rating_grade` int(11) NOT NULL,
`rating_date` date NOT NULL,
`rating_text` varchar(150) DEFAULT NULL,
`rating_text` varchar(700) DEFAULT NULL,
`rating_pοrtion_size` enum('small','medium','big') DEFAULT NULL,
PRIMARY KEY (`user_id`,`drink_id`),
KEY `user_rates_drink_id_idx` (`drink_id`),
@ -57,4 +57,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-12-22 19:43:59
-- Dump completed on 2018-12-23 18:53:55

4
Database implementation/dumps/Project Folder/flavours_without_borders_user_rates_food.sql

@ -29,7 +29,7 @@ CREATE TABLE `user_rates_food` (
`food_id` int(11) NOT NULL,
`rating_grade` int(11) NOT NULL,
`rating_date` date NOT NULL,
`rating_text` varchar(150) DEFAULT NULL,
`rating_text` varchar(700) DEFAULT NULL,
`rating_pοrtion_size` enum('small','medium','big') DEFAULT NULL,
PRIMARY KEY (`user_id`,`food_id`),
KEY `user_rates_food_id_idx` (`food_id`),
@ -57,4 +57,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-12-22 19:43:57
-- Dump completed on 2018-12-23 18:53:53

4
Database implementation/dumps/Project Folder/flavours_without_borders_user_rates_restaurant.sql

@ -30,7 +30,7 @@ CREATE TABLE `user_rates_restaurant` (
`diet_id` int(11) DEFAULT NULL,
`rating_grade` int(11) NOT NULL,
`rating_date` date NOT NULL,
`rating_text` varchar(150) DEFAULT NULL,
`rating_text` varchar(700) DEFAULT NULL,
`rating_accessibility` enum('easy','moderate','hard') DEFAULT NULL,
PRIMARY KEY (`user_id`,`restaurant_id`),
KEY `user_rates_restaurant_id_idx` (`restaurant_id`),
@ -60,4 +60,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-12-22 19:44:01
-- Dump completed on 2018-12-23 18:53:57

40
Database implementation/dumps/Self Contained/dump.sql

@ -26,8 +26,8 @@ DROP TABLE IF EXISTS `diet`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `diet` (
`diet_id` int(11) NOT NULL,
`diet_name` varchar(200) NOT NULL,
`diet_description` varchar(350) DEFAULT NULL,
`diet_name` varchar(500) NOT NULL,
`diet_description` varchar(700) DEFAULT NULL,
`diet_is_approved` bit(1) DEFAULT b'0',
PRIMARY KEY (`diet_id`),
UNIQUE KEY `diet_id_UNIQUE` (`diet_id`)
@ -53,7 +53,7 @@ DROP TABLE IF EXISTS `diet_prohibits_ingredient`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `diet_prohibits_ingredient` (
`diet_id` int(11) NOT NULL,
`ingredient_name` varchar(200) NOT NULL,
`ingredient_name` varchar(500) NOT NULL,
PRIMARY KEY (`diet_id`,`ingredient_name`),
KEY `diet_prohibits_ingredient_name_idx` (`ingredient_name`),
CONSTRAINT `diet_prohibits_has_diet_id` FOREIGN KEY (`diet_id`) REFERENCES `diet` (`diet_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
@ -80,8 +80,8 @@ DROP TABLE IF EXISTS `drink`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `drink` (
`drink_id` int(11) NOT NULL,
`drink_name` varchar(200) NOT NULL,
`drink_description` varchar(150) DEFAULT NULL,
`drink_name` varchar(500) NOT NULL,
`drink_description` varchar(700) DEFAULT NULL,
`drink_has_alcohol` bit(1) NOT NULL,
`drink_is_approved` bit(1) DEFAULT b'0',
`restaurant_id` int(11) NOT NULL,
@ -111,7 +111,7 @@ DROP TABLE IF EXISTS `drink_has_ingredient`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `drink_has_ingredient` (
`drink_id` int(11) NOT NULL,
`ingredient_name` varchar(200) NOT NULL,
`ingredient_name` varchar(500) NOT NULL,
PRIMARY KEY (`drink_id`,`ingredient_name`),
KEY `ingredient_name_idx` (`ingredient_name`),
CONSTRAINT `drink_has_drink_id` FOREIGN KEY (`drink_id`) REFERENCES `drink` (`drink_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
@ -138,8 +138,8 @@ DROP TABLE IF EXISTS `food`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `food` (
`food_id` int(11) NOT NULL,
`food_name` varchar(200) NOT NULL,
`food_description` varchar(150) DEFAULT NULL,
`food_name` varchar(500) NOT NULL,
`food_description` varchar(700) DEFAULT NULL,
`food_calories` int(11) DEFAULT NULL,
`food_is_approved` bit(1) DEFAULT b'0',
`restaurant_id` int(11) NOT NULL,
@ -169,7 +169,7 @@ DROP TABLE IF EXISTS `food_has_ingredient`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `food_has_ingredient` (
`food_id` int(11) NOT NULL,
`ingredient_name` varchar(200) NOT NULL,
`ingredient_name` varchar(500) NOT NULL,
PRIMARY KEY (`food_id`,`ingredient_name`),
KEY `ingredient_name_idx` (`ingredient_name`),
CONSTRAINT `food_has_food_id` FOREIGN KEY (`food_id`) REFERENCES `food` (`food_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
@ -195,7 +195,7 @@ DROP TABLE IF EXISTS `ingredient`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ingredient` (
`ingredient_name` varchar(200) NOT NULL,
`ingredient_name` varchar(500) NOT NULL,
`ingredient_has_alcohol` bit(1) DEFAULT b'0',
PRIMARY KEY (`ingredient_name`),
UNIQUE KEY `ingredient_name_UNIQUE` (`ingredient_name`)
@ -249,7 +249,7 @@ DROP TABLE IF EXISTS `permission`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `permission` (
`permission_id` int(11) NOT NULL,
`permission_description` varchar(45) NOT NULL,
`permission_description` varchar(700) NOT NULL,
PRIMARY KEY (`permission_id`),
UNIQUE KEY `permission_id_UNIQUE` (`permission_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -274,7 +274,7 @@ DROP TABLE IF EXISTS `restaurant`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `restaurant` (
`restaurant_id` int(11) NOT NULL,
`restaurant_name` varchar(200) NOT NULL,
`restaurant_name` varchar(500) NOT NULL,
`restaurant_category` enum('cafeteria','pub','bar','restaurant','fast_food','ethnic') NOT NULL,
`restaurant_longitude` float NOT NULL,
`restaurant_latitude` float NOT NULL,
@ -308,8 +308,8 @@ DROP TABLE IF EXISTS `role`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `role` (
`role_id` int(11) NOT NULL,
`role_name` varchar(200) NOT NULL,
`role_description` varchar(150) NOT NULL,
`role_name` varchar(500) NOT NULL,
`role_description` varchar(700) NOT NULL,
PRIMARY KEY (`role_id`),
UNIQUE KEY `role_id_UNIQUE` (`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -362,7 +362,7 @@ DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`user_id` int(11) NOT NULL,
`user_email` varchar(500) NOT NULL,
`user_username` varchar(200) NOT NULL,
`user_username` varchar(500) NOT NULL,
`user_hashed_password` char(64) NOT NULL,
`user_salt` char(32) NOT NULL,
`role_id` int(11) NOT NULL,
@ -420,7 +420,7 @@ DROP TABLE IF EXISTS `user_prohibits_ingredient`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_prohibits_ingredient` (
`user_id` int(11) NOT NULL,
`ingredient_name` varchar(200) NOT NULL,
`ingredient_name` varchar(500) NOT NULL,
PRIMARY KEY (`user_id`,`ingredient_name`),
KEY `user_prohibits_ingredient_name_idx` (`ingredient_name`),
CONSTRAINT `user_prohibits_has_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
@ -450,7 +450,7 @@ CREATE TABLE `user_rates_drink` (
`drink_id` int(11) NOT NULL,
`rating_grade` int(11) NOT NULL,
`rating_date` date NOT NULL,
`rating_text` varchar(150) DEFAULT NULL,
`rating_text` varchar(700) DEFAULT NULL,
`rating_pοrtion_size` enum('small','medium','big') DEFAULT NULL,
PRIMARY KEY (`user_id`,`drink_id`),
KEY `user_rates_drink_id_idx` (`drink_id`),
@ -481,7 +481,7 @@ CREATE TABLE `user_rates_food` (
`food_id` int(11) NOT NULL,
`rating_grade` int(11) NOT NULL,
`rating_date` date NOT NULL,
`rating_text` varchar(150) DEFAULT NULL,
`rating_text` varchar(700) DEFAULT NULL,
`rating_pοrtion_size` enum('small','medium','big') DEFAULT NULL,
PRIMARY KEY (`user_id`,`food_id`),
KEY `user_rates_food_id_idx` (`food_id`),
@ -513,7 +513,7 @@ CREATE TABLE `user_rates_restaurant` (
`diet_id` int(11) DEFAULT NULL,
`rating_grade` int(11) NOT NULL,
`rating_date` date NOT NULL,
`rating_text` varchar(150) DEFAULT NULL,
`rating_text` varchar(700) DEFAULT NULL,
`rating_accessibility` enum('easy','moderate','hard') DEFAULT NULL,
PRIMARY KEY (`user_id`,`restaurant_id`),
KEY `user_rates_restaurant_id_idx` (`restaurant_id`),
@ -607,4 +607,4 @@ SET character_set_client = @saved_cs_client;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-12-22 19:43:12
-- Dump completed on 2018-12-23 18:52:52

BIN
Database implementation/model/erd.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 KiB

After

Width:  |  Height:  |  Size: 193 KiB

4817
Database implementation/model/erd.svg

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 250 KiB

After

Width:  |  Height:  |  Size: 248 KiB

BIN
Database implementation/model/model.mwb

Binary file not shown.

7
Database implementation/queries/query_12.sql

@ -1,4 +1,3 @@
SELECT DISTINCT restaurant.restaurant_name
FROM flavours_without_borders.food JOIN flavours_without_borders.restaurant
ON food.restaurant_id = restaurant.restaurant_id
WHERE food.food_calories < 500
SELECT DISTINCT restaurant_name
FROM flavours_without_borders.users_view
WHERE food_calories < 500

6
Database implementation/queries/query_5.sql

@ -1,3 +1,3 @@
SELECT drink_name
FROM flavours_without_borders.drink
WHERE restaurant_id = 1356
SELECT DISTINCT drink_name
FROM flavours_without_borders.users_view
WHERE restaurant_id = 1356 AND drink_name IS NOT NULL

5
Database implementation/queries/query_6.sql

@ -1,4 +1,3 @@
SELECT ingredient_name
FROM flavours_without_borders.drink JOIN flavours_without_borders.drink_has_ingredient
ON drink.drink_id = drink_has_ingredient.drink_id
WHERE drink.drink_id = 6363
FROM flavours_without_borders.users_view
WHERE drink_id = 6363

Loading…
Cancel
Save