-
Notifications
You must be signed in to change notification settings - Fork 0
/
blogsite.sql
260 lines (208 loc) · 7.69 KB
/
blogsite.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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:4306
-- Generation Time: May 08, 2023 at 10:18 PM
-- Server version: 10.4.28-MariaDB
-- PHP Version: 8.0.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
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: `blogsite`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin`
--
CREATE TABLE `admin` (
`id` int(11) NOT NULL,
`email` varchar(200) NOT NULL,
`password` varchar(500) NOT NULL,
`date` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `admin`
--
INSERT INTO `admin` (`id`, `email`, `password`, `date`) VALUES
(4, '[email protected]', '$2y$12$HP9yMU7ND.83aak5UmmDM.xXm24RuxXcq8cEfhPgCS5C2yoA8jM0q', '2023-05-09 00:54:11');
-- --------------------------------------------------------
--
-- Table structure for table `blogsdata`
--
CREATE TABLE `blogsdata` (
`id` int(11) NOT NULL,
`title` varchar(255) NOT NULL,
`content` longtext NOT NULL,
`user_id` int(11) NOT NULL,
`blog_image` varchar(255) NOT NULL,
`category` varchar(255) NOT NULL,
`created_on` timestamp NOT NULL DEFAULT current_timestamp(),
`status` tinyint(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `blogsdata`
--
INSERT INTO `blogsdata` (`id`, `title`, `content`, `user_id`, `blog_image`, `category`, `created_on`, `status`) VALUES
(230, 'trying and searching and wanting', '<p>I am sitting on my balcony. It is spring and there is a little bit of heat in the sun. The balcony looks out over a road. The road is usually busy… an endless stream of trucks and cars but right now there is no traffic. Everyone is self-isolating. The machine has stopped. It feels strange. Peaceful. I can hear different birds… the wren, the blackbird, the robin. A blue tit is flitting from one branch to the next. Life goes on. I could sit here all day.</p><p>“Don’t try”. Those are the two simple words of advice offered by the poet Charles Bukowski.</p><p>It jars for most people to receive that advice… especially those of us who want a better world.</p><p>I have been stuck in a cycle of “trying” for a while now and I see a lot of it in the world</p><p>Trying and searching and wanting.</p><p>Everywhere I look people, including me, are rushing to the next moment.</p>', 21, 'uploads/M4L-Image-birds-768x512.jpeg', 'travel', '2023-05-08 19:53:43', 0);
-- --------------------------------------------------------
--
-- Table structure for table `blog_likes`
--
CREATE TABLE `blog_likes` (
`id` int(11) NOT NULL,
`user` int(11) NOT NULL,
`blog` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `blog_likes`
--
INSERT INTO `blog_likes` (`id`, `user`, `blog`) VALUES
(67, 22, 230);
-- --------------------------------------------------------
--
-- Table structure for table `comments`
--
CREATE TABLE `comments` (
`id` int(11) NOT NULL,
`comment` varchar(255) NOT NULL,
`uid` int(11) NOT NULL,
`bid` int(11) NOT NULL,
`likes` int(11) NOT NULL,
`status` tinyint(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `comments`
--
INSERT INTO `comments` (`id`, `comment`, `uid`, `bid`, `likes`, `status`) VALUES
(28, 'nice blog tausiq ❤️', 22, 230, 1, 0);
-- --------------------------------------------------------
--
-- Table structure for table `forgotpassword`
--
CREATE TABLE `forgotpassword` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`release_time` varchar(255) NOT NULL,
`expire_time` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `forgotpassword`
--
INSERT INTO `forgotpassword` (`id`, `user_id`, `release_time`, `expire_time`) VALUES
(27, 21, '21:54:32', '22:09:32');
-- --------------------------------------------------------
--
-- Table structure for table `userdetails`
--
CREATE TABLE `userdetails` (
`user_id` int(11) NOT NULL,
`name` varchar(20) NOT NULL,
`email` varchar(30) NOT NULL,
`avatar` varchar(50) DEFAULT '/static/images/avatar.png',
`password` varchar(255) NOT NULL,
`bio` text DEFAULT NULL,
`date` datetime NOT NULL DEFAULT current_timestamp(),
`status` tinyint(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `userdetails`
--
INSERT INTO `userdetails` (`user_id`, `name`, `email`, `avatar`, `password`, `bio`, `date`, `status`) VALUES
(21, 'tausiq samantaray', '[email protected]', 'avatar/avatar1.png', '$2y$10$7B081mbeph91bIsSL5NyMOuNi/VxOYh6tikc5VsNA30Lj/F.7NRvG', 'I am new here.', '2023-05-09 01:18:48', 1),
(22, 'yogajeevan mohanty', '[email protected]', 'avatar/avatar2.png', '$2y$10$OIvzmpV5J6vLwkE8Q4mkf.4QAlLZyypLXyqr44WdMxhcmlFkvMEwS', '', '2023-05-09 01:27:43', 0);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `admin`
--
ALTER TABLE `admin`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `blogsdata`
--
ALTER TABLE `blogsdata`
ADD PRIMARY KEY (`id`),
ADD KEY `user_id` (`user_id`);
--
-- Indexes for table `blog_likes`
--
ALTER TABLE `blog_likes`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `comments`
--
ALTER TABLE `comments`
ADD PRIMARY KEY (`id`),
ADD KEY `user_id` (`uid`),
ADD KEY `bid` (`bid`);
--
-- Indexes for table `forgotpassword`
--
ALTER TABLE `forgotpassword`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `user_id` (`user_id`);
--
-- Indexes for table `userdetails`
--
ALTER TABLE `userdetails`
ADD PRIMARY KEY (`user_id`),
ADD UNIQUE KEY `name` (`name`),
ADD UNIQUE KEY `email` (`email`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `admin`
--
ALTER TABLE `admin`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `blogsdata`
--
ALTER TABLE `blogsdata`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=231;
--
-- AUTO_INCREMENT for table `blog_likes`
--
ALTER TABLE `blog_likes`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=68;
--
-- AUTO_INCREMENT for table `comments`
--
ALTER TABLE `comments`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;
--
-- AUTO_INCREMENT for table `forgotpassword`
--
ALTER TABLE `forgotpassword`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;
--
-- AUTO_INCREMENT for table `userdetails`
--
ALTER TABLE `userdetails`
MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `blogsdata`
--
ALTER TABLE `blogsdata`
ADD CONSTRAINT `blogsdata_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `userdetails` (`user_id`);
--
-- Constraints for table `comments`
--
ALTER TABLE `comments`
ADD CONSTRAINT `comments_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `userdetails` (`user_id`),
ADD CONSTRAINT `comments_ibfk_2` FOREIGN KEY (`bid`) REFERENCES `blogsdata` (`id`);
COMMIT;
/*!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 */;