-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomplete-blog-php.sql
197 lines (163 loc) · 17.1 KB
/
complete-blog-php.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
-- phpMyAdmin SQL Dump
-- version 4.5.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 07, 2020 at 10:09 PM
-- Server version: 10.1.10-MariaDB
-- PHP Version: 5.6.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `complete-blog-php`
--
-- --------------------------------------------------------
--
-- Table structure for table `posts`
--
CREATE TABLE `posts` (
`id` int(11) NOT NULL,
`user_id` int(11) DEFAULT NULL,
`title` varchar(255) NOT NULL,
`slug` varchar(255) NOT NULL,
`views` int(11) NOT NULL DEFAULT '0',
`image` varchar(255) NOT NULL,
`body` text NOT NULL,
`published` tinyint(1) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `posts`
--
INSERT INTO `posts` (`id`, `user_id`, `title`, `slug`, `views`, `image`, `body`, `published`, `created_at`, `updated_at`) VALUES
(6, 1, 'A day in the life of a VITian', 'a-day-in-the-life-of-a-vitian', 0, 'vit.png', '<p>It is one of the most famous universities present in our country. When you look for engineering you cannot get a better private institution apart from VIT. The campus is very well surrounded, eco-friendly, classy. The number of students are around 25000 which provides a great exposure. The placements are amazing as most of the students return by getting a job from here. The management is very strict and handles everything smoothly. The scope of higher studies are also the best as they provide the best education as well as the guidance to achieve global success.</p>\r\n\r\n<p>Life is a very broad term. I&rsquo;m going to try and provide you with some facts. Life is good (mostly) and hard (sometimes) because it&rsquo;s a nice package altogether. Career wise you get to study in one of the best engineering colleges in India.</p>\r\n\r\n<p>The campus is pretty and huge. The infrastructure is good and the library is cool. It is a very green campus. There&rsquo;s ample amount of places that you can hang out with your friends , in and out of VIT. There are many student clubs and chapters in VIT which caters to your interests. It&rsquo;ll give you exposure and some work experience. As a current 2nd year I have experienced plenty of clubs and have had my friends talk about many others so I have a pretty good idea of what you&#39;re going through 😒.</p>\r\n\r\n<p>First things first it completely depends on your interests. VIT has a club for all!&nbsp;As a Btech student I&#39;m kind of a tech-head, and finding a perfect tech club was really confusing early on, As there just too many TBH 😂.</p>\r\n\r\n<p><strong>As per on-Campus restaurant/ cafe</strong>&nbsp;VIT has four on-campus food places, namely,</p>\r\n\r\n<ul>\r\n <li>SJT canteen</li>\r\n <li>FC</li>\r\n <li>DC</li>\r\n <li>Darling canteen.</li>\r\n <li>Dominoes ðŸ˜</li>\r\n</ul>\r\n\r\n<p>O Oh, and there&rsquo;s also a juice shop near the library, which happens to be my personal favourite.</p>\r\n\r\n<p><strong>As per out-Of-Campus restaurants/cafe: </strong>There are a decent number of food places around the campus. You&rsquo;ll get almost anything you want.</p>\r\n\r\n<ul>\r\n <li>Apna dhaba</li>\r\n <li>Punjabi mess (the place where you get wonderful paratha&#39;s made by aunty)</li>\r\n <li>China Valley</li>\r\n <li>Tara ma restaurant</li>\r\n <li>Saleem</li>\r\n <li>Calcutta rolls</li>\r\n <li>Lalit vihar(this place is a bit far from VIT but the food is awesome)</li>\r\n <li>Punjabi Dhabba(the one in front of CMC)</li>\r\n <li>Places with some what high rates</li>\r\n <li>Tom&#39;s Dinner</li>\r\n <li>Olive Kitchen</li>\r\n <li>GRT</li>\r\n <li>100&#39;s heritage</li>\r\n</ul>\r\n\r\n<p>Yes, life at VIT can get a bit challenging sometimes. But, I believe it&rsquo;s all preparing you for the harsh world outside of your protected comfort zone. It will teach you to live a balanced and disciplined life. Make sure you give your best, participate in extra-curricular activities, develop hobbies, pick up opportunities and you&rsquo;ll have the time of your life.</p>\r\n\r\n<p><em>Everything is manageable if you do it right. So, have fun, study, socialise and make memories for life.</em></p>\r\n', 1, '2020-08-27 08:58:27', '2020-08-27 08:58:27'),
(7, 1, 'Printing patterns on java made easy!', 'printing-patterns-on-java-made-easy-', 0, 'java.jpeg', '<h2>Here is a quick an easy solution to print patterns</h2>\r\n\r\n<p>This can help you get&nbsp;started with your Java programming course if you are a B-tech student. The code is as follows:</p>\r\n\r\n<p>import java.util.*;<br />\r\npublic class DecisionMaking<br />\r\n{<br />\r\npublic static void main(String[] args)<br />\r\n&nbsp;&nbsp; &nbsp;{<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Scanner sc = new Scanner(System.in);<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println(&quot;Enter the number&quot;);<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;int num = sc.nextInt();<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;int count = 1;<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;for ( int row = 1; row &lt;= num; row++)<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;for ( int column = 1; column &lt;= num; column++)<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if(column &gt;= num + 1 - row)<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.print(&quot;*&quot;);<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.print(&quot; &quot;);&nbsp;&nbsp; &nbsp;<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;for ( int column = 2; column &lt;= num; column++)<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if(column &lt;= row )<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.print(&quot;*&quot;);<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.print(&quot; &quot;);&nbsp;&nbsp; &nbsp;<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println();<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;for ( int row = 2; row &lt;= num; row++)<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;for ( int column = 1; column &lt;= num; column++)<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if(column &gt;= row )<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.print(&quot;*&quot;);<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.print(&quot; &quot;);&nbsp;&nbsp; &nbsp;<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;for ( int column = 2; column &lt;= num; column++)<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if(column &lt;= num + 1 - row)<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.print(&quot;*&quot;);<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.print(&quot; &quot;);&nbsp;&nbsp; &nbsp;<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println();<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br />\r\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br />\r\n&nbsp;&nbsp; &nbsp;}</p>\r\n\r\n<p>}</p>\r\n', 1, '2020-08-27 09:06:06', '2020-08-27 09:06:06'),
(8, 1, 'History of the VIT tank', 'history-of-the-vit-tank', 0, 'tank.png', '<blockquote>\r\n<p>I still remember it was placed next to hexagon during construction of underground bridge and students used to make fun that they got tanker to make a big hole under railway track.&nbsp;</p>\r\n</blockquote>\r\n\r\n<p>VIT maintains healthy relationship with vellore cantonment and few defence organizations by providing support to their causes and employee welfare. Generally these old tanks which are decommissioned will be sold to iron scrap dealers but it was given to VIT.</p>\r\n\r\n<p>If VIT wants something from any Govt/Pvt domains they will get it very easily and i can share small incident to tell everyone about power corridors of main building.</p>\r\n\r\n<p>Everyone knows new bus stand circle under bridge VIT maintains park with security. CMC is just 1.2 KM from that park and they want to develop and maintain it because it&rsquo;s prestige for any organization and CMC,VIT are in neck to neck competition.</p>\r\n\r\n<p>Corporation and district authorities everyone inclined towards CMC in last movement and Issue got escalated to chancellor and he made couple of calls and city corporation handed over park to VIT in a month.</p>\r\n\r\n<p><strong>Specifications:</strong></p>\r\n\r\n<p>The tank near smv is a decommissioned Vijayanta tank, an India made variant of the British Vicker&#39;s MBT. Indian army widely used them in the 80s, they were used during operation bluestar, but were eventually replaced by the T 72 s.</p>\r\n', 1, '2020-09-07 19:35:30', '2020-09-07 19:35:30'),
(14, 2, 'Test', 'test', 0, 'timetable.png', '<p>test</p>\r\n', 0, '2020-09-07 19:36:12', '2020-09-07 19:36:12');
-- --------------------------------------------------------
--
-- Table structure for table `post_topic`
--
CREATE TABLE `post_topic` (
`id` int(11) NOT NULL,
`post_id` int(11) NOT NULL,
`topic_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `post_topic`
--
INSERT INTO `post_topic` (`id`, `post_id`, `topic_id`) VALUES
(2, 6, 3),
(1, 7, 1),
(6, 14, 4);
-- --------------------------------------------------------
--
-- Table structure for table `topics`
--
CREATE TABLE `topics` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`slug` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `topics`
--
INSERT INTO `topics` (`id`, `name`, `slug`) VALUES
(1, 'Technology', 'technology'),
(2, 'Academics', 'academics'),
(3, 'Entertainment', 'entertainment'),
(4, 'test1', 'test1');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`username` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`role` enum('Author','Admin') DEFAULT 'Author',
`password` varchar(255) NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `username`, `email`, `role`, `password`, `created_at`, `updated_at`) VALUES
(1, 'Ritika', '[email protected]', 'Admin', 'password', '2020-08-24 10:39:58', '2020-08-24 10:39:58'),
(2, 'Nitish123', '[email protected]', 'Admin', '1a1dc91c907325c69271ddf0c944bc72', '2020-08-24 14:40:57', '2020-08-24 14:40:57'),
(3, 'test', '[email protected]', 'Author', '098f6bcd4621d373cade4e832627b4f6', '2020-08-24 16:36:11', '2020-08-24 16:36:11');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `posts`
--
ALTER TABLE `posts`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `slug` (`slug`),
ADD KEY `user_id` (`user_id`);
--
-- Indexes for table `post_topic`
--
ALTER TABLE `post_topic`
ADD PRIMARY KEY (`id`,`topic_id`),
ADD UNIQUE KEY `post_id` (`post_id`),
ADD KEY `topic_id` (`topic_id`);
--
-- Indexes for table `topics`
--
ALTER TABLE `topics`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `slug` (`slug`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `email` (`email`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `posts`
--
ALTER TABLE `posts`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `post_topic`
--
ALTER TABLE `post_topic`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `topics`
--
ALTER TABLE `topics`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `posts`
--
ALTER TABLE `posts`
ADD CONSTRAINT `posts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `post_topic`
--
ALTER TABLE `post_topic`
ADD CONSTRAINT `post_topic_ibfk_1` FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION,
ADD CONSTRAINT `post_topic_ibfk_2` FOREIGN KEY (`topic_id`) REFERENCES `topics` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;