-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.sql
More file actions
executable file
·55 lines (47 loc) · 1.5 KB
/
schema.sql
File metadata and controls
executable file
·55 lines (47 loc) · 1.5 KB
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
-- schema.sql
drop database if exists awesome;
create database awesome;
use awesome;
grant select, insert, update, delete on awesome.* to 'yoite'@'localhost' identified by '71546';
create table users (
`id` varchar(50) not null,
`email` varchar(50) not null,
`passwd` varchar(50) not null,
`admin` bool not null,
`name` varchar(50) not null,
`image` varchar(500) not null,
`created_at` real not null,
unique key `idx_email` (`email`),
key `idx_created_at` (`created_at`),
primary key (`id`)
) engine=innodb default charset=utf8;
create table record (
`id` varchar(50) not null,
`user_id` varchar(50) not null,
`genres` varchar(50) not null,
`title` varchar(50),
`content` mediumtext not null,
`trash` bool not null,
`archive` bool not null,
`is_delete` bool not null,
`created_at` real not null,
key `idx_created_at` (`created_at`),
primary key (`id`)
) engine=innodb default charset=utf8;
create table tags (
`id` varchar(50) not null,
`tag` varchar(50) not null,
`user_id` varchar(50) not null,
`created_at` real not null,
key `idx_created_at` (`created_at`),
primary key (`id`)
) engine=innodb default charset=utf8;
create table relationship (
`id` varchar(50) not null,
`tag` varchar(50) not null,
`tag_id` varchar(50) not null,
`record_id` varchar(50) not null,
`created_at` real not null,
key `idx_created_at` (`created_at`),
primary key (`id`)
) engine=innodb default charset=utf8;