-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathschema.sql
43 lines (37 loc) · 1.07 KB
/
schema.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
drop database if exists jblog;
create database jblog;
use jblog;
grant select,insert,update,delete on jblog.* to 'jiffies'@'%' identified by 'jiffies';
-- generating SQL for users:
create table `users` (
`id` varchar(50) not null,
`email` varchar(50) not null,
`password` varchar(50) not null,
`admin` bool not null,
`created_at` real not null,
primary key(`id`)
) engine=innodb default charset=utf8;
-- generating SQL for blogs:
create table `blogs` (
`id` varchar(50) not null,
`user_id` varchar(50) not null,
`title` varchar(50) not null,
`content` text not null,
`image` varchar(500) not null,
`created_at` real not null,
primary key(`id`)
) engine=innodb default charset=utf8;
-- generating SQL for tags:
create table `tags` (
`id` varchar(50) not null,
`name` varchar(50) not null,
`number` bigint not null,
primary key(`id`)
)default charset=utf8;
-- generating SQL for blogtag:
create table `blogtag` (
`id` varchar(50) not null,
`blog_id` varchar(50) not null,
`tag_id` varchar(50) not null,
primary key(`id`)
)default charset=utf8;