|
|
@ -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 |
|
|
|