-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharticle_repo.sql
49 lines (39 loc) · 1.29 KB
/
article_repo.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
44
45
46
47
48
49
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `article_repo`
--
-- --------------------------------------------------------
--
-- Table structure for table `articles`
--
CREATE TABLE IF NOT EXISTS `articles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`hash` varchar(64) NOT NULL,
`title` varchar(100) NOT NULL,
`url` varchar(255) NOT NULL,
`image_url` varchar(255) NOT NULL,
`summary` text NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `hash` (`hash`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
-- --------------------------------------------------------
--
-- Table structure for table `article_tags`
--
CREATE TABLE IF NOT EXISTS `article_tags` (
`article_id` int(11) NOT NULL,
`tag` varchar(20) NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE KEY `uniques` (`article_id`,`tag`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `domain_articles`
--
CREATE TABLE IF NOT EXISTS `domain_articles` (
`aritcle_id` int(11) NOT NULL,
`domain_hash` varchar(100) NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`aritcle_id`,`domain_hash`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;