Skip to content

Commit 78301ce

Browse files
author
lishuhuakai
committed
add sql file
1 parent 4c2f58b commit 78301ce

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
drop database if exists awesome;
2+
3+
create database awesome;
4+
5+
use awesome;
6+
7+
grant select, insert, update, delete on awesome.* to 'www-data'@'localhost' identified by 'www-data';
8+
9+
create table users (
10+
`id` varchar(50) not null,
11+
`email` varchar(50) not null,
12+
`passwd` varchar(50) not null,
13+
`admin` bool not null,
14+
`name` varchar(50) not null,
15+
`image` varchar(500) not null,
16+
`created_at` real not null,
17+
unique key `idx_email` (`email`),
18+
key `idx_created_at` (`created_at`),
19+
primary key (`id`)
20+
) engine=innodb default charset=utf8;
21+
22+
create table blogs (
23+
`id` varchar(50) not null,
24+
`user_id` varchar(50) not null,
25+
`user_name` varchar(50) not null,
26+
`user_image` varchar(500) not null,
27+
`name` varchar(50) not null,
28+
`summary` varchar(200) not null,
29+
`content` mediumtext not null,
30+
`created_at` real not null,
31+
key `idx_created_at` (`created_at`),
32+
primary key (`id`)
33+
) engine=innodb default charset=utf8;
34+
35+
create table comments (
36+
`id` varchar(50) not null,
37+
`blog_id` varchar(50) not null,
38+
`user_id` varchar(50) not null,
39+
`user_name` varchar(50) not null,
40+
`user_image` varchar(500) not null,
41+
`content` mediumtext not null,
42+
`created_at` real not null,
43+
key `idx_created_at` (`created_at`),
44+
primary key (`id`)
45+
) engine=innodb default charset=utf8;

0 commit comments

Comments
 (0)