]> git.wh0rd.org - tt-rss.git/blame - schema/ttrss_schema_mysql.sql
add preferences tab
[tt-rss.git] / schema / ttrss_schema_mysql.sql
CommitLineData
eb36b4eb 1drop table if exists ttrss_tags;
648472a7
AD
2drop table if exists ttrss_entries;
3drop table if exists ttrss_feeds;
4
5create table ttrss_feeds (id integer not null auto_increment primary key,
6 title varchar(200) not null unique,
7 feed_url varchar(250) unique not null,
8 icon_url varchar(250) not null default '',
d148926e 9 update_interval integer not null default 0,
1089b16b 10 purge_interval integer not null default 0,
ab3d0b99 11 last_updated datetime default '',
37d379de
AD
12 last_error text not null default '',
13 site_url varchar(250) not null default '') TYPE=InnoDB;
648472a7
AD
14
15insert into ttrss_feeds (title,feed_url) values ('Footnotes', 'http://gnomedesktop.org/node/feed');
16insert into ttrss_feeds (title,feed_url) values ('Freedesktop.org', 'http://planet.freedesktop.org/rss20.xml');
17insert into ttrss_feeds (title,feed_url) values ('Planet Debian', 'http://planet.debian.org/rss20.xml');
18insert into ttrss_feeds (title,feed_url) values ('Planet GNOME', 'http://planet.gnome.org/rss20.xml');
19insert into ttrss_feeds (title,feed_url) values ('Planet Ubuntu', 'http://planet.ubuntulinux.org/rss20.xml');
20
21insert into ttrss_feeds (title,feed_url) values ('Monologue', 'http://www.go-mono.com/monologue/index.rss');
22
23insert into ttrss_feeds (title,feed_url) values ('Latest Linux Kernel Versions',
24 'http://kernel.org/kdist/rss.xml');
25
26insert into ttrss_feeds (title,feed_url) values ('RPGDot Newsfeed',
27 'http://www.rpgdot.com/team/rss/rss0.xml');
28
29insert into ttrss_feeds (title,feed_url) values ('Digg.com News',
30 'http://digg.com/rss/index.xml');
31
32insert into ttrss_feeds (title,feed_url) values ('Technocrat.net',
33 'http://syndication.technocrat.net/rss');
34
35create table ttrss_entries (id integer not null primary key auto_increment,
1696229f 36 feed_id integer not null,
8158c57a 37 updated datetime not null,
9ad5b0de 38 title text not null,
a0d5a39a 39 guid varchar(255) not null unique,
49a0dd3d 40 link text not null,
648472a7
AD
41 content text not null,
42 content_hash varchar(250) not null,
8158c57a
AD
43 last_read datetime,
44 marked bool not null default 0,
45 date_entered datetime not null,
46 no_orig_date bool not null default 0,
648472a7 47 comments varchar(250) not null default '',
1696229f
AD
48 unread bool not null default 1,
49 index (feed_id),
50 foreign key (feed_id) references ttrss_feeds(id) ON DELETE CASCADE) TYPE=InnoDB;
648472a7
AD
51
52drop table if exists ttrss_filters;
53drop table if exists ttrss_filter_types;
54
55create table ttrss_filter_types (id integer primary key,
56 name varchar(120) unique not null,
4b3dff6e 57 description varchar(250) not null unique) TYPE=InnoDB;
648472a7 58
648472a7
AD
59
60insert into ttrss_filter_types (id,name,description) values (1, 'title', 'Title');
61insert into ttrss_filter_types (id,name,description) values (2, 'content', 'Content');
62insert into ttrss_filter_types (id,name,description) values (3, 'both',
63 'Title or Content');
64
4b3dff6e 65create table ttrss_filters (id integer primary key auto_increment,
8158c57a 66 filter_type integer not null references ttrss_filter_types(id),
4b3dff6e
AD
67 reg_exp varchar(250) not null,
68 description varchar(250) not null default '') TYPE=InnoDB;
648472a7 69
a82065a1 70drop table if exists ttrss_labels;
48f0adb0 71
a82065a1 72create table ttrss_labels (id integer primary key auto_increment,
48f0adb0 73 sql_exp varchar(250) not null,
a82065a1 74 description varchar(250) not null) TYPE=InnoDB;
48f0adb0 75
48f0adb0
AD
76insert into ttrss_labels (sql_exp,description) values ('unread = true',
77 'Unread articles');
648472a7 78
7cc6112a
AD
79insert into ttrss_labels (sql_exp,description) values (
80 'last_read is null and unread = false', 'Updated articles');
81
eb36b4eb
AD
82create table ttrss_tags (id integer primary key auto_increment,
83 tag_name varchar(250) not null,
1696229f
AD
84 post_id integer not null,
85 index (post_id),
86 foreign key (post_id) references ttrss_entries(id) ON DELETE CASCADE) TYPE=InnoDB;
eb36b4eb 87
5f171894
AD
88drop table ttrss_version;
89
90create table ttrss_version (schema_version int not null) TYPE=InnoDB;
91
1089b16b 92insert into ttrss_version values (2);
5f171894 93
e0257be1
AD
94create table ttrss_prefs_types (id integer primary key,
95 type_name varchar(100) not null) TYPE=InnoDB;
96
97insert into ttrss_prefs_types (id, type_name) values (1, 'bool');
98insert into ttrss_prefs_types (id, type_name) values (2, 'string');
99insert into ttrss_prefs_types (id, type_name) values (3, 'integer');
100
101create table ttrss_prefs_sections (id integer primary key,
102 section_name varchar(100) not null) TYPE=InnoDB;
103
104insert into ttrss_prefs_sections (id, section_name) values (1, 'PLACEHOLDER');
105
106create table ttrss_prefs (pref_name varchar(250) primary key,
107 type_id integer not null,
108 section_id integer not null default 1,
109 def_value text not null,
110 value text not null,
111 index(type_id),
112 foreign key (type_id) references ttrss_prefs_types(id),
113 index(section_id),
114 foreign key (section_id) references ttrss_prefs_sections(id)) TYPE=InnoDB;
115
116insert into ttrss_prefs (pref_name,type_id,value,def_value) values('CONTENT_CHECK_MD5', 1, 'false', 'false');
117insert into ttrss_prefs (pref_name,type_id,value,def_value) values('MIN_UPDATE_TIME', 3, '1800', '1800');
e0257be1
AD
118insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ENABLE_FEED_ICONS', 1, 'true', 'true');
119insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ICONS_DIR', 2, 'icons', 'icons');
120insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ICONS_URL', 2, 'icons', 'icons');
121insert into ttrss_prefs (pref_name,type_id,value,def_value) values('PURGE_OLD_DAYS', 3, '60', '60');
122insert into ttrss_prefs (pref_name,type_id,value,def_value) values('UPDATE_POST_ON_CHECKSUM_CHANGE', 1, 'true', 'true');
4769ddaf 123insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ENABLE_PREFS_CATCHUP_UNCATCHUP', 1, 'false', 'false');
e0257be1
AD
124insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ENABLE_LABELS', 1, 'false', 'false');
125insert into ttrss_prefs (pref_name,type_id,value,def_value) values('DEFAULT_UPDATE_INTERVAL', 3, '30', '30');
126insert into ttrss_prefs (pref_name,type_id,value,def_value) values('DISPLAY_HEADER', 1, 'true', 'true');
127insert into ttrss_prefs (pref_name,type_id,value,def_value) values('DISPLAY_FOOTER', 1, 'true', 'true');
128insert into ttrss_prefs (pref_name,type_id,value,def_value) values('USE_COMPACT_STYLESHEET', 1, 'false', 'false');
129insert into ttrss_prefs (pref_name,type_id,value,def_value) values('DEFAULT_ARTICLE_LIMIT', 3, '0', '0');
130insert into ttrss_prefs (pref_name,type_id,value,def_value) values('DAEMON_REFRESH_ONLY', 1, 'false', 'false');
131insert into ttrss_prefs (pref_name,type_id,value,def_value) values('DISPLAY_FEEDLIST_ACTIONS', 1, 'false', 'false');
132insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ENABLE_SPLASH', 1, 'false', 'false');
5f171894 133