]> git.wh0rd.org - tt-rss.git/blame - schema/ttrss_schema_mysql.sql
pass $link into check_feed_favicon()
[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
2fb72ab9
AD
94drop table ttrss_prefs;
95drop table ttrss_prefs_types;
96drop table ttrss_prefs_sections;
97
e0257be1
AD
98create table ttrss_prefs_types (id integer primary key,
99 type_name varchar(100) not null) TYPE=InnoDB;
100
101insert into ttrss_prefs_types (id, type_name) values (1, 'bool');
102insert into ttrss_prefs_types (id, type_name) values (2, 'string');
103insert into ttrss_prefs_types (id, type_name) values (3, 'integer');
104
105create table ttrss_prefs_sections (id integer primary key,
106 section_name varchar(100) not null) TYPE=InnoDB;
107
603e9ebe
AD
108insert into ttrss_prefs_sections (id, section_name) values (1, 'General');
109insert into ttrss_prefs_sections (id, section_name) values (2, 'Interface');
e0257be1
AD
110
111create table ttrss_prefs (pref_name varchar(250) primary key,
112 type_id integer not null,
113 section_id integer not null default 1,
603e9ebe
AD
114 short_desc text not null,
115 help_text text not null default '',
e0257be1
AD
116 def_value text not null,
117 value text not null,
118 index(type_id),
119 foreign key (type_id) references ttrss_prefs_types(id),
120 index(section_id),
121 foreign key (section_id) references ttrss_prefs_sections(id)) TYPE=InnoDB;
122
4338e23d
AD
123insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id) values('ENABLE_FEED_ICONS', 1, 'true', 'true', 'Enable icons in feedlist',2);
124insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id) values('ICONS_DIR', 2, 'icons', 'icons', 'Local directory for feed icons',1);
125insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id) values('ICONS_URL', 2, 'icons', 'icons', 'Local URL for icons',1);
126insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id) values('PURGE_OLD_DAYS', 3, '60', '60', 'Purge old posts after this number of days (0 - disables)',1);
127insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id) values('UPDATE_POST_ON_CHECKSUM_CHANGE', 1, 'true', 'true', 'Update post on checksum change',1);
128insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id) values('ENABLE_PREFS_CATCHUP_UNCATCHUP', 1, 'false', 'false', 'Enable catchup/uncatchup buttons in feed editor',2);
36990e33
AD
129insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id,help_text) values('ENABLE_LABELS', 1, 'false', 'false', 'Enable labels',1,
130 'Experimental support for virtual feeds based on user crafted SQL queries. This feature is highly experimental and at this point not user friendly. Use with caution.');
131
4338e23d
AD
132insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id) values('DEFAULT_UPDATE_INTERVAL', 3, '30', '30', 'Default interval between feed updates (in minutes)',1);
133insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id) values('DISPLAY_HEADER', 1, 'true', 'true', 'Display header',2);
134insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id) values('DISPLAY_FOOTER', 1, 'true', 'true', 'Display footer',2);
135insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id) values('USE_COMPACT_STYLESHEET', 1, 'false', 'false', 'Use compact stylesheet by default',2);
36990e33
AD
136insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id,help_text) values('DEFAULT_ARTICLE_LIMIT', 3, '0', '0', 'Default article limit',2,
137 'Default limit for articles to display, any custom number you like (0 - disables).');
138
139insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id,help_text) values('DAEMON_REFRESH_ONLY', 1, 'false', 'false', 'Daemon refresh only',1,
140 'Updates to all feeds will only run when the backend script is invoked with a "daemon" option on the URI stem.');
141
142insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id,help_text) values('DISPLAY_FEEDLIST_ACTIONS', 1, 'false', 'false', 'Display feedlist actions',2,
143 'Display separate dropbox for feedlist actions, if disabled these actions are available in global actions menu.');
144
4338e23d 145insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id) values('ENABLE_SPLASH', 1, 'false', 'false', 'Enable loading splashscreen',2);
5f171894 146