-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase_tables.sql
More file actions
43 lines (40 loc) · 1.41 KB
/
database_tables.sql
File metadata and controls
43 lines (40 loc) · 1.41 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
CREATE TABLE `bots` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(191) NOT NULL DEFAULT '',
`checked_until` int(11) unsigned NOT NULL DEFAULT '0',
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `bot_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `candidates` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`bot_id` int(11) unsigned NOT NULL,
`item_id` int(11) unsigned NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`keyword` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `item_per_bot` (`bot_id`,`item_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `items` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL DEFAULT '',
`url` varchar(255) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`content` text NOT NULL,
`summary` varchar(2000) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `url` (`url`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `rss_feeds` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`url` varchar(191) NOT NULL,
`last_updated` datetime NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`alive` tinyint(1) unsigned DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `url` (`url`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;