-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.sql
More file actions
26 lines (24 loc) · 827 Bytes
/
data.sql
File metadata and controls
26 lines (24 loc) · 827 Bytes
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
CREATE TABLE `posts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`text` text NOT NULL,
`rating` int(11) NOT NULL DEFAULT '0',
`create_user` varchar(50) NOT NULL,
`create_date` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4
CREATE TABLE `rating` (
`liked` int(11) NOT NULL,
`user` varchar(50) NOT NULL,
`thumb` varchar(1) NOT NULL,
PRIMARY KEY (`liked`,`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) NOT NULL,
`password` varchar(255) NOT NULL,
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
`ip` varchar(255) DEFAULT NULL,
`last_login` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4