Browse Source

Fix minor issue, Init views

master
Apostolos Fanakis 6 years ago
parent
commit
25812df877
  1. 2
      Database implementation/dumps/Project Folder/flavours_without_borders_diet.sql
  2. 2
      Database implementation/dumps/Project Folder/flavours_without_borders_diet_prohibits_ingredient.sql
  3. 2
      Database implementation/dumps/Project Folder/flavours_without_borders_drink.sql
  4. 2
      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. 2
      Database implementation/dumps/Project Folder/flavours_without_borders_food_has_ingredient.sql
  7. 2
      Database implementation/dumps/Project Folder/flavours_without_borders_ingredient.sql
  8. 2
      Database implementation/dumps/Project Folder/flavours_without_borders_permission.sql
  9. 2
      Database implementation/dumps/Project Folder/flavours_without_borders_restaurant.sql
  10. 2
      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_user.sql
  13. 2
      Database implementation/dumps/Project Folder/flavours_without_borders_user_follows_diet.sql
  14. 2
      Database implementation/dumps/Project Folder/flavours_without_borders_user_prohibits_ingredient.sql
  15. 2
      Database implementation/dumps/Project Folder/flavours_without_borders_user_rates_drink.sql
  16. 2
      Database implementation/dumps/Project Folder/flavours_without_borders_user_rates_food.sql
  17. 2
      Database implementation/dumps/Project Folder/flavours_without_borders_user_rates_restaurant.sql
  18. 6
      Database implementation/dumps/Self Contained/dump.sql
  19. 45
      Database implementation/views/view_1_as_query.sql

2
Database implementation/dumps/Project Folder/flavours_without_borders_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-21 13:49:51
-- Dump completed on 2018-12-21 14:34:56

2
Database implementation/dumps/Project Folder/flavours_without_borders_diet_prohibits_ingredient.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-21 13:49:55
-- Dump completed on 2018-12-21 14:34:59

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

@ -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-21 13:49:50
-- Dump completed on 2018-12-21 14:34:55

2
Database implementation/dumps/Project Folder/flavours_without_borders_drink_has_ingredient.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-21 13:49:48
-- Dump completed on 2018-12-21 14:34:52

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

@ -29,7 +29,7 @@ CREATE TABLE `food` (
`food_name` varchar(200) NOT NULL,
`food_description` varchar(150) DEFAULT NULL,
`food_calories` int(11) DEFAULT NULL,
`food_is_approved` varchar(45) DEFAULT '0',
`food_is_approved` bit(1) DEFAULT b'0',
`restaurant_id` int(11) NOT NULL,
PRIMARY KEY (`food_id`),
UNIQUE KEY `food_id_UNIQUE` (`food_id`),
@ -44,7 +44,7 @@ CREATE TABLE `food` (
LOCK TABLES `food` WRITE;
/*!40000 ALTER TABLE `food` DISABLE KEYS */;
INSERT INTO `food` VALUES (2,'Κεφτεδάκια με πατάτες',NULL,450,'TRUE',8132),(4,'Κοτομπουκιές',NULL,NULL,'FALSE',4330),(6,'Γεμιστά','Λαχταριστές ντομάτες και πιπεριές γεμιστές',326,'TRUE',8),(8,'Κεφτεδάκια με πατάτες',NULL,NULL,'FALSE',8),(48,'Burger','Είναι σαν να τρως αέρα!',1821,'TRUE',15),(68,'Μπριζολάκια','Χοιρινές μπριζόλες ξεροψημένες!',NULL,'FALSE',8132),(73,'Τυροκαυτερή','Η καλύτερη συνοδεία για τα τηγανητά κολοκυθάκια',276,'TRUE',8132),(124,'Γεμιστά','Παραδοσιακό ελληνικό πιάτο',392,'TRUE',4330),(478,'Πατσάς με σκορδοστούμπι','Ένα πιάτο που θυμίζει πολύ χωριό',450,'TRUE',4330),(548,'Fish&Chips','Μία γεύση από Αγγλία',840,'TRUE',7365);
INSERT INTO `food` VALUES (2,'Κεφτεδάκια με πατάτες',NULL,450,_binary '',8132),(4,'Κοτομπουκιές',NULL,NULL,_binary '\0',4330),(6,'Γεμιστά','Λαχταριστές ντομάτες και πιπεριές γεμιστές',326,_binary '',8),(8,'Κεφτεδάκια με πατάτες',NULL,NULL,_binary '\0',8),(48,'Burger','Είναι σαν να τρως αέρα!',1821,_binary '',15),(68,'Μπριζολάκια','Χοιρινές μπριζόλες ξεροψημένες!',NULL,_binary '\0',8132),(73,'Τυροκαυτερή','Η καλύτερη συνοδεία για τα τηγανητά κολοκυθάκια',276,_binary '',8132),(124,'Γεμιστά','Παραδοσιακό ελληνικό πιάτο',392,_binary '',4330),(478,'Πατσάς με σκορδοστούμπι','Ένα πιάτο που θυμίζει πολύ χωριό',450,_binary '',4330),(548,'Fish&Chips','Μία γεύση από Αγγλία',840,_binary '',7365);
/*!40000 ALTER TABLE `food` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@ -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-21 13:49:50
-- Dump completed on 2018-12-21 14:34:54

2
Database implementation/dumps/Project Folder/flavours_without_borders_food_has_ingredient.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-21 13:50:01
-- Dump completed on 2018-12-21 14:35:06

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

@ -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-21 13:50:02
-- Dump completed on 2018-12-21 14:35:07

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

@ -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-21 13:49:49
-- Dump completed on 2018-12-21 14:34:53

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

@ -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-21 13:49:56
-- Dump completed on 2018-12-21 14:35:00

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

@ -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-21 13:50:00
-- Dump completed on 2018-12-21 14:35:05

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-21 13:50:00
-- Dump completed on 2018-12-21 14:35:04

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

@ -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-21 13:49:53
-- Dump completed on 2018-12-21 14:34:58

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-21 13:49:58
-- Dump completed on 2018-12-21 14:35:02

2
Database implementation/dumps/Project Folder/flavours_without_borders_user_prohibits_ingredient.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-21 13:49:59
-- Dump completed on 2018-12-21 14:35:03

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

@ -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-21 13:49:54
-- Dump completed on 2018-12-21 14:34:58

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

@ -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-21 13:49:52
-- Dump completed on 2018-12-21 14:34:57

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

@ -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-21 13:49:57
-- Dump completed on 2018-12-21 14:35:01

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

@ -141,7 +141,7 @@ CREATE TABLE `food` (
`food_name` varchar(200) NOT NULL,
`food_description` varchar(150) DEFAULT NULL,
`food_calories` int(11) DEFAULT NULL,
`food_is_approved` varchar(45) DEFAULT '0',
`food_is_approved` bit(1) DEFAULT b'0',
`restaurant_id` int(11) NOT NULL,
PRIMARY KEY (`food_id`),
UNIQUE KEY `food_id_UNIQUE` (`food_id`),
@ -156,7 +156,7 @@ CREATE TABLE `food` (
LOCK TABLES `food` WRITE;
/*!40000 ALTER TABLE `food` DISABLE KEYS */;
INSERT INTO `food` VALUES (2,'Κεφτεδάκια με πατάτες',NULL,450,'TRUE',8132),(4,'Κοτομπουκιές',NULL,NULL,'FALSE',4330),(6,'Γεμιστά','Λαχταριστές ντομάτες και πιπεριές γεμιστές',326,'TRUE',8),(8,'Κεφτεδάκια με πατάτες',NULL,NULL,'FALSE',8),(48,'Burger','Είναι σαν να τρως αέρα!',1821,'TRUE',15),(68,'Μπριζολάκια','Χοιρινές μπριζόλες ξεροψημένες!',NULL,'FALSE',8132),(73,'Τυροκαυτερή','Η καλύτερη συνοδεία για τα τηγανητά κολοκυθάκια',276,'TRUE',8132),(124,'Γεμιστά','Παραδοσιακό ελληνικό πιάτο',392,'TRUE',4330),(478,'Πατσάς με σκορδοστούμπι','Ένα πιάτο που θυμίζει πολύ χωριό',450,'TRUE',4330),(548,'Fish&Chips','Μία γεύση από Αγγλία',840,'TRUE',7365);
INSERT INTO `food` VALUES (2,'Κεφτεδάκια με πατάτες',NULL,450,_binary '',8132),(4,'Κοτομπουκιές',NULL,NULL,_binary '\0',4330),(6,'Γεμιστά','Λαχταριστές ντομάτες και πιπεριές γεμιστές',326,_binary '',8),(8,'Κεφτεδάκια με πατάτες',NULL,NULL,_binary '\0',8),(48,'Burger','Είναι σαν να τρως αέρα!',1821,_binary '',15),(68,'Μπριζολάκια','Χοιρινές μπριζόλες ξεροψημένες!',NULL,_binary '\0',8132),(73,'Τυροκαυτερή','Η καλύτερη συνοδεία για τα τηγανητά κολοκυθάκια',276,_binary '',8132),(124,'Γεμιστά','Παραδοσιακό ελληνικό πιάτο',392,_binary '',4330),(478,'Πατσάς με σκορδοστούμπι','Ένα πιάτο που θυμίζει πολύ χωριό',450,_binary '',4330),(548,'Fish&Chips','Μία γεύση από Αγγλία',840,_binary '',7365);
/*!40000 ALTER TABLE `food` ENABLE KEYS */;
UNLOCK TABLES;
@ -515,4 +515,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-12-21 13:51:00
-- Dump completed on 2018-12-21 14:35:34

45
Database implementation/views/view_1_as_query.sql

@ -0,0 +1,45 @@
SELECT `restaurant`.`restaurant_id`,
`restaurant`.`restaurant_name`,
`restaurant`.`restaurant_category`,
`restaurant`.`restaurant_longitude`,
`restaurant`.`restaurant_latitude`,
`restaurant`.`restaurant_opening`,
`restaurant`.`restaurant_closing`,
`restaurant`.`user_id`,
`food`.`food_id` AS `item_id`,
`food`.`food_name` AS `item_name`,
`food`.`food_description` AS `item_description`,
`food`.`food_calories` AS `item_calories`,
`ingredient`.`ingredient_name`,
`ingredient`.`ingredient_has_alcohol`
FROM flavours_without_borders.restaurant
LEFT JOIN flavours_without_borders.food
ON restaurant.restaurant_id = food.restaurant_id
LEFT JOIN flavours_without_borders.food_has_ingredient
ON food.food_id = food_has_ingredient.food_id
LEFT JOIN flavours_without_borders.ingredient
ON food_has_ingredient.ingredient_name = ingredient.ingredient_name
WHERE restaurant.restaurant_is_approved = TRUE AND food.food_is_approved = TRUE
UNION
SELECT `restaurant`.`restaurant_id`,
`restaurant`.`restaurant_name`,
`restaurant`.`restaurant_category`,
`restaurant`.`restaurant_longitude`,
`restaurant`.`restaurant_latitude`,
`restaurant`.`restaurant_opening`,
`restaurant`.`restaurant_closing`,
`restaurant`.`user_id`,
`drink`.`drink_id` AS `item_id`,
`drink`.`drink_name` AS `item_name`,
`drink`.`drink_description` AS `item_description`,
NULL AS `item_calories`,
`ingredient`.`ingredient_name`,
`ingredient`.`ingredient_has_alcohol`
FROM flavours_without_borders.restaurant
LEFT JOIN flavours_without_borders.drink
ON restaurant.restaurant_id = drink.restaurant_id
LEFT JOIN flavours_without_borders.drink_has_ingredient
ON drink.drink_id = drink_has_ingredient.drink_id
LEFT JOIN flavours_without_borders.ingredient
ON drink_has_ingredient.ingredient_name = ingredient.ingredient_name
WHERE restaurant.restaurant_is_approved = TRUE AND drink.drink_is_approved = TRUE
Loading…
Cancel
Save