Advertisement
Guest User

Untitled

a guest
Dec 23rd, 2017
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 7.26 KB | None | 0 0
  1. -- phpMyAdmin SQL Dump
  2. -- version 4.7.2
  3. -- https://www.phpmyadmin.net/
  4. --
  5. -- Host: localhost
  6. -- Generation Time: Dec 20, 2017 at 08:55 AM
  7. -- Server version: 10.1.26-MariaDB
  8. -- PHP Version: 7.1.8
  9.  
  10. SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  11. SET AUTOCOMMIT = 0;
  12. START TRANSACTION;
  13. SET time_zone = "+00:00";
  14.  
  15.  
  16. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  17. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  18. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  19. /*!40101 SET NAMES utf8mb4 */;
  20.  
  21. --
  22. -- Database: `SocialNet`
  23. --
  24.  
  25. -- --------------------------------------------------------
  26.  
  27. --
  28. -- Table structure for table `friend_requests`
  29. --
  30.  
  31. CREATE TABLE `friend_requests` (
  32.   `id` INT(11) NOT NULL,
  33.   `user_to` VARCHAR(100) NOT NULL,
  34.   `user_from` VARCHAR(100) NOT NULL
  35. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  36.  
  37. -- --------------------------------------------------------
  38.  
  39. --
  40. -- Table structure for table `likes`
  41. --
  42.  
  43. CREATE TABLE `likes` (
  44.   `id` INT(11) NOT NULL,
  45.   `email` VARCHAR(100) NOT NULL,
  46.   `post_id` INT(11) NOT NULL
  47. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  48.  
  49. --
  50. -- Dumping data for table `likes`
  51. --
  52.  
  53. INSERT INTO `likes` (`id`, `email`, `post_id`) VALUES
  54. (35, 'islamelgaafary@gmail.com', 140),
  55. (36, 'iss@f.com', 140);
  56.  
  57. -- --------------------------------------------------------
  58.  
  59. --
  60. -- Table structure for table `notifications`
  61. --
  62.  
  63. CREATE TABLE `notifications` (
  64.   `id` INT(11) NOT NULL,
  65.   `user_to` VARCHAR(100) NOT NULL,
  66.   `user_from` VARCHAR(100) NOT NULL,
  67.   `message` text NOT NULL,
  68.   `link` VARCHAR(100) NOT NULL,
  69.   `datetime` datetime NOT NULL,
  70.   `opened` VARCHAR(3) NOT NULL,
  71.   `viewed` VARCHAR(3) NOT NULL
  72. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  73.  
  74. --
  75. -- Dumping data for table `notifications`
  76. --
  77.  
  78. INSERT INTO `notifications` (`id`, `user_to`, `user_from`, `message`, `link`, `datetime`, `opened`, `viewed`) VALUES
  79. (13, 'islamelgaafary@gmail.com', 'iss@f.com', 'Moaz Ezz liked your post', 'post.php?id=140', '2017-12-20 07:25:47', 'YES', 'YES');
  80.  
  81. -- --------------------------------------------------------
  82.  
  83. --
  84. -- Table structure for table `phoneNumber`
  85. --
  86.  
  87. CREATE TABLE `phoneNumber` (
  88.   `phoneNum` INT(11) NOT NULL,
  89.   `user_email` VARCHAR(100) NOT NULL
  90. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  91.  
  92. -- --------------------------------------------------------
  93.  
  94. --
  95. -- Table structure for table `posts`
  96. --
  97.  
  98. CREATE TABLE `posts` (
  99.   `id` INT(11) NOT NULL,
  100.   `body` text NOT NULL,
  101.   `added_by` VARCHAR(60) NOT NULL,
  102.   `user_to` VARCHAR(60) NOT NULL,
  103.   `user_closed` VARCHAR(3) NOT NULL,
  104.   `deleted` VARCHAR(3) NOT NULL,
  105.   `likes` INT(11) NOT NULL,
  106.   `date_added` datetime NOT NULL,
  107.   `is_public` VARCHAR(3) NOT NULL,
  108.   `image` VARCHAR(100) NOT NULL
  109. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  110.  
  111. --
  112. -- Dumping data for table `posts`
  113. --
  114.  
  115. INSERT INTO `posts` (`id`, `body`, `added_by`, `user_to`, `user_closed`, `deleted`, `likes`, `date_added`, `is_public`, `image`) VALUES
  116. (141, 'gggg', 'islamelgaafary@gmail.com', 'none', 'NO', 'NO', 0, '2017-12-20 07:26:36', 'NO', ''),
  117. (142, 'hhhh', 'iss@f.com', 'none', 'NO', 'NO', 0, '2017-12-20 07:43:44', 'YES', '');
  118.  
  119. -- --------------------------------------------------------
  120.  
  121. --
  122. -- Table structure for table `users`
  123. --
  124.  
  125. CREATE TABLE `users` (
  126.   `email` VARCHAR(100) NOT NULL,
  127.   `first_name` VARCHAR(20) NOT NULL,
  128.   `last_name` VARCHAR(25) NOT NULL,
  129.   `nickname` VARCHAR(100) NOT NULL,
  130.   `password` VARCHAR(255) NOT NULL,
  131.   `gender` VARCHAR(10) NOT NULL,
  132.   `DoB` DATE NOT NULL,
  133.   `profile_pic` VARCHAR(255) NOT NULL,
  134.   `hometown` VARCHAR(100) NOT NULL,
  135.   `marital_state` VARCHAR(10) NOT NULL,
  136.   `about_me` text NOT NULL,
  137.   `friend_array` text NOT NULL,
  138.   `user_closed` VARCHAR(3) NOT NULL,
  139.   `num_posts` INT(11) NOT NULL,
  140.   `num_likes` INT(11) NOT NULL,
  141.   `signup_date` DATE NOT NULL
  142. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  143.  
  144. --
  145. -- Dumping data for table `users`
  146. --
  147.  
  148. INSERT INTO `users` (`email`, `first_name`, `last_name`, `nickname`, `password`, `gender`, `DoB`, `profile_pic`, `hometown`, `marital_state`, `about_me`, `friend_array`, `user_closed`, `num_posts`, `num_likes`, `signup_date`) VALUES
  149. ('islamelgaafary@gmail.com', 'Islam', 'Elgaafary', 'Islam_nabil', '96e79218965eb72c92a549dd5a330112', 'Male', '2017-12-20', 'assets/images/profile_pics/defaults/boy_3.png', 'Alexandria', 'Single', 'gggg', ',', 'NO', 10, 2, '2017-12-20'),
  150. ('iss@f.com', 'Moaz', 'Ezz', 'M_e', '96e79218965eb72c92a549dd5a330112', 'Male', '2017-11-29', 'assets/images/profile_pics/defaults/boy_4.png', '', 'Married', 'ffff', ',', 'NO', 1, 0, '2017-12-20');
  151.  
  152. --
  153. -- Indexes for dumped tables
  154. --
  155.  
  156. --
  157. -- Indexes for table `friend_requests`
  158. --
  159. ALTER TABLE `friend_requests`
  160.   ADD PRIMARY KEY (`id`),
  161.   ADD KEY `user_from` (`user_from`),
  162.   ADD KEY `user_to` (`user_to`);
  163.  
  164. --
  165. -- Indexes for table `likes`
  166. --
  167. ALTER TABLE `likes`
  168.   ADD PRIMARY KEY (`id`),
  169.   ADD KEY `email` (`email`);
  170.  
  171. --
  172. -- Indexes for table `notifications`
  173. --
  174. ALTER TABLE `notifications`
  175.   ADD PRIMARY KEY (`id`),
  176.   ADD KEY `user_from` (`user_from`),
  177.   ADD KEY `user_to` (`user_to`);
  178.  
  179. --
  180. -- Indexes for table `phoneNumber`
  181. --
  182. ALTER TABLE `phoneNumber`
  183.   ADD PRIMARY KEY (`phoneNum`),
  184.   ADD KEY `user_email` (`user_email`);
  185.  
  186. --
  187. -- Indexes for table `posts`
  188. --
  189. ALTER TABLE `posts`
  190.   ADD PRIMARY KEY (`id`),
  191.   ADD KEY `added_by` (`added_by`);
  192.  
  193. --
  194. -- Indexes for table `users`
  195. --
  196. ALTER TABLE `users`
  197.   ADD PRIMARY KEY (`email`);
  198.  
  199. --
  200. -- AUTO_INCREMENT for dumped tables
  201. --
  202.  
  203. --
  204. -- AUTO_INCREMENT for table `friend_requests`
  205. --
  206. ALTER TABLE `friend_requests`
  207.   MODIFY `id` INT(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
  208. --
  209. -- AUTO_INCREMENT for table `likes`
  210. --
  211. ALTER TABLE `likes`
  212.   MODIFY `id` INT(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=37;
  213. --
  214. -- AUTO_INCREMENT for table `notifications`
  215. --
  216. ALTER TABLE `notifications`
  217.   MODIFY `id` INT(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
  218. --
  219. -- AUTO_INCREMENT for table `posts`
  220. --
  221. ALTER TABLE `posts`
  222.   MODIFY `id` INT(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=143;
  223. --
  224. -- Constraints for dumped tables
  225. --
  226.  
  227. --
  228. -- Constraints for table `friend_requests`
  229. --
  230. ALTER TABLE `friend_requests`
  231.   ADD CONSTRAINT `friend_requests_ibfk_1` FOREIGN KEY (`user_from`) REFERENCES `users` (`email`),
  232.   ADD CONSTRAINT `friend_requests_ibfk_2` FOREIGN KEY (`user_to`) REFERENCES `users` (`email`);
  233.  
  234. --
  235. -- Constraints for table `likes`
  236. --
  237. ALTER TABLE `likes`
  238.   ADD CONSTRAINT `likes_ibfk_1` FOREIGN KEY (`email`) REFERENCES `users` (`email`);
  239.  
  240. --
  241. -- Constraints for table `notifications`
  242. --
  243. ALTER TABLE `notifications`
  244.   ADD CONSTRAINT `notifications_ibfk_1` FOREIGN KEY (`user_from`) REFERENCES `users` (`email`),
  245.   ADD CONSTRAINT `notifications_ibfk_2` FOREIGN KEY (`user_to`) REFERENCES `users` (`email`);
  246.  
  247. --
  248. -- Constraints for table `phoneNumber`
  249. --
  250. ALTER TABLE `phoneNumber`
  251.   ADD CONSTRAINT `phoneNumber_ibfk_1` FOREIGN KEY (`user_email`) REFERENCES `users` (`email`);
  252.  
  253. --
  254. -- Constraints for table `posts`
  255. --
  256. ALTER TABLE `posts`
  257.   ADD CONSTRAINT `posts_ibfk_1` FOREIGN KEY (`added_by`) REFERENCES `users` (`email`);
  258. COMMIT;
  259.  
  260. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  261. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  262. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement