]>
Commit | Line | Data |
---|---|---|
1 | SET NAMES utf8; | |
2 | SET CHARACTER SET utf8; | |
3 | ||
4 | drop table if exists ttrss_linked_feeds; | |
5 | drop table if exists ttrss_linked_instances; | |
6 | drop table if exists ttrss_access_keys; | |
7 | drop table if exists ttrss_user_labels2; | |
8 | drop table if exists ttrss_labels2; | |
9 | drop table if exists ttrss_feedbrowser_cache; | |
10 | drop table if exists ttrss_version; | |
11 | drop table if exists ttrss_labels; | |
12 | drop table if exists ttrss_filters2_actions; | |
13 | drop table if exists ttrss_filters2_rules; | |
14 | drop table if exists ttrss_filters2; | |
15 | drop table if exists ttrss_filters; | |
16 | drop table if exists ttrss_filter_types; | |
17 | drop table if exists ttrss_filter_actions; | |
18 | drop table if exists ttrss_user_prefs; | |
19 | drop table if exists ttrss_prefs; | |
20 | drop table if exists ttrss_prefs_types; | |
21 | drop table if exists ttrss_prefs_sections; | |
22 | drop table if exists ttrss_tags; | |
23 | drop table if exists ttrss_enclosures; | |
24 | drop table if exists ttrss_settings_profiles; | |
25 | drop table if exists ttrss_entry_comments; | |
26 | drop table if exists ttrss_user_entries; | |
27 | drop table if exists ttrss_entries; | |
28 | drop table if exists ttrss_scheduled_updates; | |
29 | drop table if exists ttrss_counters_cache; | |
30 | drop table if exists ttrss_cat_counters_cache; | |
31 | drop table if exists ttrss_feeds; | |
32 | drop table if exists ttrss_archived_feeds; | |
33 | drop table if exists ttrss_feed_categories; | |
34 | drop table if exists ttrss_users; | |
35 | drop table if exists ttrss_themes; | |
36 | drop table if exists ttrss_sessions; | |
37 | ||
38 | begin; | |
39 | ||
40 | create table ttrss_users (id integer primary key not null auto_increment, | |
41 | login varchar(120) not null unique, | |
42 | pwd_hash varchar(250) not null, | |
43 | last_login datetime default null, | |
44 | access_level integer not null default 0, | |
45 | theme_id integer default null, | |
46 | email varchar(250) not null default '', | |
47 | full_name varchar(250) not null default '', | |
48 | email_digest bool not null default false, | |
49 | last_digest_sent datetime default null, | |
50 | salt varchar(250) not null default '', | |
51 | created datetime default null, | |
52 | twitter_oauth longtext default null, | |
53 | otp_enabled boolean not null default false, | |
54 | index (theme_id)) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
55 | ||
56 | insert into ttrss_users (login,pwd_hash,access_level) values ('admin', | |
57 | 'SHA1:5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 10); | |
58 | ||
59 | create table ttrss_feed_categories(id integer not null primary key auto_increment, | |
60 | owner_uid integer not null, | |
61 | title varchar(200) not null, | |
62 | collapsed bool not null default false, | |
63 | order_id integer not null default 0, | |
64 | parent_cat integer, | |
65 | index(parent_cat), | |
66 | foreign key (parent_cat) references ttrss_feed_categories(id) ON DELETE SET NULL, | |
67 | index(owner_uid), | |
68 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
69 | ||
70 | create table ttrss_archived_feeds (id integer not null primary key, | |
71 | owner_uid integer not null, | |
72 | title varchar(200) not null, | |
73 | feed_url text not null, | |
74 | site_url varchar(250) not null default '', | |
75 | index(owner_uid), | |
76 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
77 | ||
78 | create table ttrss_counters_cache ( | |
79 | feed_id integer not null, | |
80 | owner_uid integer not null, | |
81 | value integer not null default 0, | |
82 | updated datetime not null, | |
83 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE | |
84 | ); | |
85 | ||
86 | create index ttrss_counters_cache_feed_id_idx on ttrss_counters_cache(feed_id); | |
87 | create index ttrss_counters_cache_owner_uid_idx on ttrss_counters_cache(owner_uid); | |
88 | create index ttrss_counters_cache_value_idx on ttrss_counters_cache(value); | |
89 | ||
90 | create table ttrss_cat_counters_cache ( | |
91 | feed_id integer not null, | |
92 | owner_uid integer not null, | |
93 | value integer not null default 0, | |
94 | updated datetime not null, | |
95 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE | |
96 | ); | |
97 | ||
98 | create index ttrss_cat_counters_cache_owner_uid_idx on ttrss_cat_counters_cache(owner_uid); | |
99 | ||
100 | create table ttrss_feeds (id integer not null auto_increment primary key, | |
101 | owner_uid integer not null, | |
102 | title varchar(200) not null, | |
103 | cat_id integer default null, | |
104 | feed_url text not null, | |
105 | icon_url varchar(250) not null default '', | |
106 | update_interval integer not null default 0, | |
107 | purge_interval integer not null default 0, | |
108 | last_updated datetime default 0, | |
109 | last_error varchar(250) not null default '', | |
110 | site_url varchar(250) not null default '', | |
111 | auth_login varchar(250) not null default '', | |
112 | auth_pass varchar(250) not null default '', | |
113 | parent_feed integer default null, | |
114 | private bool not null default false, | |
115 | rtl_content bool not null default false, | |
116 | hidden bool not null default false, | |
117 | include_in_digest boolean not null default true, | |
118 | cache_images boolean not null default false, | |
119 | cache_content boolean not null default false, | |
120 | auth_pass_encrypted boolean not null default false, | |
121 | last_viewed datetime default null, | |
122 | last_update_started datetime default null, | |
123 | always_display_enclosures boolean not null default false, | |
124 | update_method integer not null default 0, | |
125 | order_id integer not null default 0, | |
126 | mark_unread_on_update boolean not null default false, | |
127 | update_on_checksum_change boolean not null default false, | |
128 | strip_images boolean not null default false, | |
129 | pubsub_state integer not null default 0, | |
130 | favicon_last_checked datetime default null, | |
131 | index(owner_uid), | |
132 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE, | |
133 | index(cat_id), | |
134 | foreign key (cat_id) references ttrss_feed_categories(id) ON DELETE SET NULL, | |
135 | index(parent_feed), | |
136 | foreign key (parent_feed) references ttrss_feeds(id) ON DELETE SET NULL) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
137 | ||
138 | create index ttrss_feeds_owner_uid_index on ttrss_feeds(owner_uid); | |
139 | create index ttrss_feeds_cat_id_idx on ttrss_feeds(cat_id); | |
140 | ||
141 | insert into ttrss_feeds (owner_uid, title, feed_url) values | |
142 | (1, 'Tiny Tiny RSS: New Releases', 'http://tt-rss.org/releases.rss'); | |
143 | ||
144 | insert into ttrss_feeds (owner_uid, title, feed_url) values | |
145 | (1, 'Tiny Tiny RSS: Forum', 'http://tt-rss.org/forum/rss.php'); | |
146 | ||
147 | create table ttrss_entries (id integer not null primary key auto_increment, | |
148 | title text not null, | |
149 | guid varchar(255) not null unique, | |
150 | link text not null, | |
151 | updated datetime not null, | |
152 | content longtext not null, | |
153 | content_hash varchar(250) not null, | |
154 | cached_content longtext, | |
155 | no_orig_date bool not null default 0, | |
156 | date_entered datetime not null, | |
157 | date_updated datetime not null, | |
158 | num_comments integer not null default 0, | |
159 | comments varchar(250) not null default '', | |
160 | author varchar(250) not null default '') ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
161 | ||
162 | create index ttrss_entries_date_entered_index on ttrss_entries(date_entered); | |
163 | create index ttrss_entries_guid_index on ttrss_entries(guid); | |
164 | create index ttrss_entries_updated_idx on ttrss_entries(updated); | |
165 | ||
166 | create table ttrss_user_entries ( | |
167 | int_id integer not null primary key auto_increment, | |
168 | ref_id integer not null, | |
169 | uuid varchar(200) not null, | |
170 | feed_id int, | |
171 | orig_feed_id int, | |
172 | owner_uid integer not null, | |
173 | marked bool not null default 0, | |
174 | published bool not null default 0, | |
175 | tag_cache text not null, | |
176 | label_cache text not null, | |
177 | last_read datetime, | |
178 | score int not null default 0, | |
179 | note longtext, | |
180 | unread bool not null default 1, | |
181 | index (ref_id), | |
182 | foreign key (ref_id) references ttrss_entries(id) ON DELETE CASCADE, | |
183 | index (feed_id), | |
184 | foreign key (feed_id) references ttrss_feeds(id) ON DELETE CASCADE, | |
185 | index (orig_feed_id), | |
186 | foreign key (orig_feed_id) references ttrss_archived_feeds(id) ON DELETE SET NULL, | |
187 | index (owner_uid), | |
188 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
189 | ||
190 | create index ttrss_user_entries_owner_uid_index on ttrss_user_entries(owner_uid); | |
191 | create index ttrss_user_entries_ref_id_index on ttrss_user_entries(ref_id); | |
192 | create index ttrss_user_entries_feed_id on ttrss_user_entries(feed_id); | |
193 | create index ttrss_user_entries_unread_idx on ttrss_user_entries(unread); | |
194 | ||
195 | create table ttrss_entry_comments (id integer not null primary key, | |
196 | ref_id integer not null, | |
197 | owner_uid integer not null, | |
198 | private bool not null default 0, | |
199 | date_entered datetime not null, | |
200 | index (ref_id), | |
201 | foreign key (ref_id) references ttrss_entries(id) ON DELETE CASCADE, | |
202 | index (owner_uid), | |
203 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
204 | ||
205 | create table ttrss_filter_types (id integer primary key, | |
206 | name varchar(120) unique not null, | |
207 | description varchar(250) not null unique) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
208 | ||
209 | insert into ttrss_filter_types (id,name,description) values (1, 'title', 'Title'); | |
210 | insert into ttrss_filter_types (id,name,description) values (2, 'content', 'Content'); | |
211 | insert into ttrss_filter_types (id,name,description) values (3, 'both', | |
212 | 'Title or Content'); | |
213 | insert into ttrss_filter_types (id,name,description) values (4, 'link', | |
214 | 'Link'); | |
215 | insert into ttrss_filter_types (id,name,description) values (5, 'date', | |
216 | 'Article Date'); | |
217 | insert into ttrss_filter_types (id,name,description) values (6, 'author', 'Author'); | |
218 | insert into ttrss_filter_types (id,name,description) values (7, 'tag', 'Article Tags'); | |
219 | ||
220 | create table ttrss_filter_actions (id integer not null primary key, | |
221 | name varchar(120) unique not null, | |
222 | description varchar(250) not null unique) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
223 | ||
224 | insert into ttrss_filter_actions (id,name,description) values (1, 'filter', | |
225 | 'Delete article'); | |
226 | ||
227 | insert into ttrss_filter_actions (id,name,description) values (2, 'catchup', | |
228 | 'Mark as read'); | |
229 | ||
230 | insert into ttrss_filter_actions (id,name,description) values (3, 'mark', | |
231 | 'Set starred'); | |
232 | ||
233 | insert into ttrss_filter_actions (id,name,description) values (4, 'tag', | |
234 | 'Assign tags'); | |
235 | ||
236 | insert into ttrss_filter_actions (id,name,description) values (5, 'publish', | |
237 | 'Publish article'); | |
238 | ||
239 | insert into ttrss_filter_actions (id,name,description) values (6, 'score', | |
240 | 'Modify score'); | |
241 | ||
242 | insert into ttrss_filter_actions (id,name,description) values (7, 'label', | |
243 | 'Assign label'); | |
244 | ||
245 | create table ttrss_filters (id integer not null primary key auto_increment, | |
246 | owner_uid integer not null, | |
247 | feed_id integer default null, | |
248 | filter_type integer not null, | |
249 | reg_exp varchar(250) not null, | |
250 | filter_param varchar(250) not null default '', | |
251 | inverse bool not null default false, | |
252 | enabled bool not null default true, | |
253 | cat_filter bool not null default false, | |
254 | cat_id integer default null, | |
255 | action_id integer not null default 1, | |
256 | action_param varchar(250) not null default '', | |
257 | index (filter_type), | |
258 | foreign key (filter_type) references ttrss_filter_types(id) ON DELETE CASCADE, | |
259 | index (owner_uid), | |
260 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE, | |
261 | index (feed_id), | |
262 | foreign key (feed_id) references ttrss_feeds(id) ON DELETE CASCADE, | |
263 | index (cat_id), | |
264 | foreign key (cat_id) references ttrss_feed_categories(id) ON DELETE CASCADE, | |
265 | index (action_id), | |
266 | foreign key (action_id) references ttrss_filter_actions(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
267 | ||
268 | create table ttrss_filters2(id integer primary key auto_increment, | |
269 | owner_uid integer not null, | |
270 | match_any_rule boolean not null default false, | |
271 | enabled boolean not null default true, | |
272 | index(owner_uid), | |
273 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
274 | ||
275 | create table ttrss_filters2_rules(id integer primary key auto_increment, | |
276 | filter_id integer not null references ttrss_filters2(id) on delete cascade, | |
277 | reg_exp varchar(250) not null, | |
278 | filter_type integer not null, | |
279 | feed_id integer default null, | |
280 | cat_id integer default null, | |
281 | cat_filter boolean not null default false, | |
282 | index (filter_id), | |
283 | foreign key (filter_id) references ttrss_filters2(id) on delete cascade, | |
284 | index (filter_type), | |
285 | foreign key (filter_type) references ttrss_filter_types(id) ON DELETE CASCADE, | |
286 | index (feed_id), | |
287 | foreign key (feed_id) references ttrss_feeds(id) ON DELETE CASCADE, | |
288 | index (cat_id), | |
289 | foreign key (cat_id) references ttrss_feed_categories(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
290 | ||
291 | create table ttrss_filters2_actions(id integer primary key auto_increment, | |
292 | filter_id integer not null, | |
293 | action_id integer not null default 1 references ttrss_filter_actions(id) on delete cascade, | |
294 | action_param varchar(250) not null default '', | |
295 | index (filter_id), | |
296 | foreign key (filter_id) references ttrss_filters2(id) on delete cascade, | |
297 | index (action_id), | |
298 | foreign key (action_id) references ttrss_filter_actions(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
299 | ||
300 | create table ttrss_tags (id integer primary key auto_increment, | |
301 | owner_uid integer not null, | |
302 | tag_name varchar(250) not null, | |
303 | post_int_id integer not null, | |
304 | index (post_int_id), | |
305 | foreign key (post_int_id) references ttrss_user_entries(int_id) ON DELETE CASCADE, | |
306 | index (owner_uid), | |
307 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
308 | ||
309 | create table ttrss_version (schema_version int not null) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
310 | ||
311 | insert into ttrss_version values (99); | |
312 | ||
313 | create table ttrss_enclosures (id integer primary key auto_increment, | |
314 | content_url text not null, | |
315 | content_type varchar(250) not null, | |
316 | post_id integer not null, | |
317 | title text not null, | |
318 | duration text not null, | |
319 | index (post_id), | |
320 | foreign key (post_id) references ttrss_entries(id) ON DELETE cascade) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
321 | ||
322 | create index ttrss_enclosures_post_id_idx on ttrss_enclosures(post_id); | |
323 | ||
324 | create table ttrss_settings_profiles(id integer primary key auto_increment, | |
325 | title varchar(250) not null, | |
326 | owner_uid integer not null, | |
327 | index (owner_uid), | |
328 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
329 | ||
330 | create table ttrss_prefs_types (id integer not null primary key, | |
331 | type_name varchar(100) not null) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
332 | ||
333 | insert into ttrss_prefs_types (id, type_name) values (1, 'bool'); | |
334 | insert into ttrss_prefs_types (id, type_name) values (2, 'string'); | |
335 | insert into ttrss_prefs_types (id, type_name) values (3, 'integer'); | |
336 | ||
337 | create table ttrss_prefs_sections (id integer not null primary key, | |
338 | order_id integer not null, | |
339 | section_name varchar(100) not null) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
340 | ||
341 | insert into ttrss_prefs_sections (id, section_name, order_id) values (1, 'General', 0); | |
342 | insert into ttrss_prefs_sections (id, section_name, order_id) values (2, 'Interface', 1); | |
343 | insert into ttrss_prefs_sections (id, section_name, order_id) values (3, 'Advanced', 3); | |
344 | insert into ttrss_prefs_sections (id, section_name, order_id) values (4, 'Digest', 2); | |
345 | ||
346 | create table ttrss_prefs (pref_name varchar(250) not null primary key, | |
347 | type_id integer not null, | |
348 | section_id integer not null default 1, | |
349 | short_desc text not null, | |
350 | help_text varchar(250) not null default '', | |
351 | access_level integer not null default 0, | |
352 | def_value text not null, | |
353 | index(type_id), | |
354 | foreign key (type_id) references ttrss_prefs_types(id), | |
355 | index(section_id), | |
356 | foreign key (section_id) references ttrss_prefs_sections(id)) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
357 | ||
358 | create index ttrss_prefs_pref_name_idx on ttrss_prefs(pref_name); | |
359 | ||
360 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('PURGE_OLD_DAYS', 3, '60', 'Purge articles after this number of days (0 - disables)',1); | |
361 | ||
362 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('DEFAULT_UPDATE_INTERVAL', 3, '30', 'Default interval between feed updates',1); | |
363 | ||
364 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('DEFAULT_ARTICLE_LIMIT', 3, '30', 'Amount of articles to display at once',2); | |
365 | ||
366 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('ALLOW_DUPLICATE_POSTS', 1, 'true', 'Allow duplicate posts',1, 'This option is useful when you are reading several planet-type aggregators with partially colliding userbase. When disabled, it forces same posts from different feeds to appear only once.'); | |
367 | ||
368 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('ENABLE_FEED_CATS', 1, 'true', 'Enable feed categories',2); | |
369 | ||
370 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('SHOW_CONTENT_PREVIEW', 1, 'true', 'Show content preview in headlines list',2); | |
371 | ||
372 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('SHORT_DATE_FORMAT', 2, 'M d, G:i', 'Short date format',3); | |
373 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('LONG_DATE_FORMAT', 2, 'D, M d Y - G:i', 'Long date format',3); | |
374 | ||
375 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('COMBINED_DISPLAY_MODE', 1, 'false', 'Combined feed display',2, 'Display expanded list of feed articles, instead of separate displays for headlines and article content'); | |
376 | ||
377 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('HIDE_READ_FEEDS', 1, 'false', 'Hide feeds with no unread messages',2); | |
378 | ||
379 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('ON_CATCHUP_SHOW_NEXT_FEED', 1, 'false', 'On catchup show next feed',2, 'Automatically open next feed with unread articles after marking one as read'); | |
380 | ||
381 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('FEEDS_SORT_BY_UNREAD', 1, 'false', 'Sort feeds by unread articles count',2); | |
382 | ||
383 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('REVERSE_HEADLINES', 1, 'false', 'Reverse headline order (oldest first)',2); | |
384 | ||
385 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('DIGEST_ENABLE', 1, 'false', 'Enable e-mail digest',4, 'This option enables sending daily digest of new (and unread) headlines on your configured e-mail address'); | |
386 | ||
387 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('CONFIRM_FEED_CATCHUP', 1, 'true', 'Confirm marking feed as read',2); | |
388 | ||
389 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('CDM_AUTO_CATCHUP', 1, 'false', 'Automatically mark articles as read',2, 'This option enables marking articles as read automatically while you scroll article list.'); | |
390 | ||
391 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_VIEW_MODE', 2, 'adaptive', '', 1); | |
392 | ||
393 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_VIEW_LIMIT', 3, '30', '', 1); | |
394 | ||
395 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_PREFS_ACTIVE_TAB', 2, '', '', 1); | |
396 | ||
397 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('STRIP_UNSAFE_TAGS', 1, 'true', 'Strip unsafe tags from articles', 3, 'Strip all but most common HTML tags when reading articles.'); | |
398 | ||
399 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('BLACKLISTED_TAGS', 2, 'main, generic, misc, uncategorized, blog, blogroll, general, news', 'Blacklisted tags', 3, 'When auto-detecting tags in articles these tags will not be applied (comma-separated list).'); | |
400 | ||
401 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('FRESH_ARTICLE_MAX_AGE', 3, '24', 'Maximum age of fresh articles (in hours)',2); | |
402 | ||
403 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('DIGEST_CATCHUP', 1, 'false', 'Mark articles in e-mail digest as read',4); | |
404 | ||
405 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('CDM_EXPANDED', 1, 'true', 'Automatically expand articles in combined mode',2); | |
406 | ||
407 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('PURGE_UNREAD_ARTICLES', 1, 'true', 'Purge unread articles',3); | |
408 | ||
409 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('HIDE_READ_SHOWS_SPECIAL', 1, 'true', 'Show special feeds when hiding read feeds',2); | |
410 | ||
411 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('VFEED_GROUP_BY_FEED', 1, 'false', 'Group headlines in virtual feeds',2, 'When this option is enabled, headlines in Special feeds and Labels are grouped by feeds'); | |
412 | ||
413 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('STRIP_IMAGES', 1, 'false', 'Do not show images in articles', 2); | |
414 | ||
415 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_VIEW_ORDER_BY', 2, 'default', '', 1); | |
416 | ||
417 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('ENABLE_API_ACCESS', 1, 'false', 'Enable external API', 1); | |
418 | ||
419 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_COLLAPSED_SPECIAL', 1, 'false', '', 1); | |
420 | ||
421 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_COLLAPSED_LABELS', 1, 'false', '', 1); | |
422 | ||
423 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_COLLAPSED_UNCAT', 1, 'false', '', 1); | |
424 | ||
425 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_COLLAPSED_FEEDLIST', 1, 'false', '', 1); | |
426 | ||
427 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_MOBILE_ENABLE_CATS', 1, 'false', '', 1); | |
428 | ||
429 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_MOBILE_SHOW_IMAGES', 1, 'false', '', 1); | |
430 | ||
431 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_MOBILE_HIDE_READ', 1, 'false', '', 1); | |
432 | ||
433 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_MOBILE_SORT_FEEDS_UNREAD', 1, 'false', '', 1); | |
434 | ||
435 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_THEME_ID', 2, '0', '', 1); | |
436 | ||
437 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('USER_TIMEZONE', 2, 'UTC', 'User timezone', 1); | |
438 | ||
439 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('USER_STYLESHEET', 2, '', 'Customize stylesheet', 2, 'Customize CSS stylesheet to your liking'); | |
440 | ||
441 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('SORT_HEADLINES_BY_FEED_DATE', 1, 'true', 'Sort headlines by feed date',2, 'Use feed-specified date to sort headlines instead of local import date.'); | |
442 | ||
443 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_MOBILE_BROWSE_CATS', 1, 'true', '', 1); | |
444 | ||
445 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('SSL_CERT_SERIAL', 2, '', 'Login with an SSL certificate',3, 'Click to register your SSL client certificate with tt-rss'); | |
446 | ||
447 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('DIGEST_PREFERRED_TIME', 2, '00:00', 'Try to send digests around specified time', 4, 'Uses UTC timezone'); | |
448 | ||
449 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_PREFS_SHOW_EMPTY_CATS', 1, 'false', '', 1); | |
450 | ||
451 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_INCLUDE_CHILDREN', 1, 'false', '', 1); | |
452 | ||
453 | insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('AUTO_ASSIGN_LABELS', 1, 'true', 'Assign articles to labels automatically', 3); | |
454 | ||
455 | update ttrss_prefs set access_level = 1 where pref_name in ('ON_CATCHUP_SHOW_NEXT_FEED', | |
456 | 'SORT_HEADLINES_BY_FEED_DATE', | |
457 | 'VFEED_GROUP_BY_FEED', | |
458 | 'FRESH_ARTICLE_MAX_AGE', | |
459 | 'CDM_EXPANDED', | |
460 | 'SHOW_CONTENT_PREVIEW', | |
461 | 'AUTO_ASSIGN_LABELS', | |
462 | 'HIDE_READ_SHOWS_SPECIAL'); | |
463 | ||
464 | create table ttrss_user_prefs ( | |
465 | owner_uid integer not null, | |
466 | pref_name varchar(250), | |
467 | value longtext not null, | |
468 | profile integer, | |
469 | index (profile), | |
470 | foreign key (profile) references ttrss_settings_profiles(id) ON DELETE CASCADE, | |
471 | index (owner_uid), | |
472 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE, | |
473 | index (pref_name), | |
474 | foreign key (pref_name) references ttrss_prefs(pref_name) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
475 | ||
476 | create index ttrss_user_prefs_owner_uid_index on ttrss_user_prefs(owner_uid); | |
477 | create index ttrss_user_prefs_pref_name_idx on ttrss_user_prefs(pref_name); | |
478 | ||
479 | create table ttrss_sessions (id varchar(250) unique not null primary key, | |
480 | data text, | |
481 | expire integer not null, | |
482 | index (id), | |
483 | index (expire)) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
484 | ||
485 | create table ttrss_feedbrowser_cache ( | |
486 | feed_url text not null, | |
487 | site_url text not null, | |
488 | title text not null, | |
489 | subscribers integer not null) DEFAULT CHARSET=UTF8; | |
490 | ||
491 | create table ttrss_labels2 (id integer not null primary key auto_increment, | |
492 | owner_uid integer not null, | |
493 | caption varchar(250) not null, | |
494 | fg_color varchar(15) not null default '', | |
495 | bg_color varchar(15) not null default '', | |
496 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE | |
497 | ) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
498 | ||
499 | create table ttrss_user_labels2 (label_id integer not null, | |
500 | article_id integer not null, | |
501 | foreign key (label_id) references ttrss_labels2(id) ON DELETE CASCADE, | |
502 | foreign key (article_id) references ttrss_entries(id) ON DELETE CASCADE | |
503 | ) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
504 | ||
505 | create table ttrss_access_keys (id integer not null primary key auto_increment, | |
506 | access_key varchar(250) not null, | |
507 | feed_id varchar(250) not null, | |
508 | is_cat bool not null default false, | |
509 | owner_uid integer not null, | |
510 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
511 | ||
512 | create table ttrss_linked_instances (id integer not null primary key auto_increment, | |
513 | last_connected datetime not null, | |
514 | last_status_in integer not null, | |
515 | last_status_out integer not null, | |
516 | access_key varchar(250) not null unique, | |
517 | access_url text not null) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
518 | ||
519 | create table ttrss_linked_feeds ( | |
520 | feed_url text not null, | |
521 | site_url text not null, | |
522 | title text not null, | |
523 | created datetime not null, | |
524 | updated datetime not null, | |
525 | instance_id integer not null, | |
526 | subscribers integer not null, | |
527 | foreign key (instance_id) references ttrss_linked_instances(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
528 | ||
529 | commit; |