2 SET CHARACTER SET utf8
;
4 drop table if exists ttrss_error_log
;
5 drop table if exists ttrss_plugin_storage
;
6 drop table if exists ttrss_linked_feeds
;
7 drop table if exists ttrss_linked_instances
;
8 drop table if exists ttrss_access_keys
;
9 drop table if exists ttrss_user_labels2
;
10 drop table if exists ttrss_labels2
;
11 drop table if exists ttrss_feedbrowser_cache
;
12 drop table if exists ttrss_version
;
13 drop table if exists ttrss_labels
;
14 drop table if exists ttrss_filters2_actions
;
15 drop table if exists ttrss_filters2_rules
;
16 drop table if exists ttrss_filters2
;
17 drop table if exists ttrss_filter_types
;
18 drop table if exists ttrss_filter_actions
;
19 drop table if exists ttrss_user_prefs
;
20 drop table if exists ttrss_prefs
;
21 drop table if exists ttrss_prefs_types
;
22 drop table if exists ttrss_prefs_sections
;
23 drop table if exists ttrss_tags
;
24 drop table if exists ttrss_enclosures
;
25 drop table if exists ttrss_settings_profiles
;
26 drop table if exists ttrss_entry_comments
;
27 drop table if exists ttrss_user_entries
;
28 drop table if exists ttrss_entries
;
29 drop table if exists ttrss_scheduled_updates
;
30 drop table if exists ttrss_counters_cache
;
31 drop table if exists ttrss_cat_counters_cache
;
32 drop table if exists ttrss_feeds
;
33 drop table if exists ttrss_archived_feeds
;
34 drop table if exists ttrss_feed_categories
;
35 drop table if exists ttrss_users
;
36 drop table if exists ttrss_themes
;
37 drop table if exists ttrss_sessions
;
41 create table ttrss_users (id integer primary key not null auto_increment
,
42 login varchar(120) not null unique,
43 pwd_hash
varchar(250) not null,
44 last_login datetime
default null,
45 access_level
integer not null default 0,
46 theme_id
integer default null,
47 email
varchar(250) not null default '',
48 full_name
varchar(250) not null default '',
49 email_digest bool
not null default false,
50 last_digest_sent datetime
default null,
51 salt
varchar(250) not null default '',
52 created datetime
default null,
53 twitter_oauth longtext
default null,
54 otp_enabled
boolean not null default false,
55 index (theme_id
)) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
57 insert into ttrss_users (login,pwd_hash
,access_level
) values ('admin',
58 'SHA1:5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 10);
60 create table ttrss_feed_categories(id integer not null primary key auto_increment
,
61 owner_uid
integer not null,
62 title
varchar(200) not null,
63 collapsed bool
not null default false,
64 order_id
integer not null default 0,
66 view_settings
varchar(250) not null default '',
68 foreign key (parent_cat
) references ttrss_feed_categories(id) ON DELETE SET NULL,
70 foreign key (owner_uid
) references ttrss_users(id) ON DELETE CASCADE) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
72 create table ttrss_archived_feeds (id integer not null primary key,
73 owner_uid
integer not null,
74 title
varchar(200) not null,
75 feed_url
text not null,
76 site_url
varchar(250) not null default '',
78 foreign key (owner_uid
) references ttrss_users(id) ON DELETE CASCADE) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
80 create table ttrss_counters_cache (
81 feed_id
integer not null,
82 owner_uid
integer not null,
83 value integer not null default 0,
84 updated datetime
not null,
85 foreign key (owner_uid
) references ttrss_users(id) ON DELETE CASCADE
88 create index ttrss_counters_cache_feed_id_idx
on ttrss_counters_cache(feed_id
);
89 create index ttrss_counters_cache_owner_uid_idx
on ttrss_counters_cache(owner_uid
);
90 create index ttrss_counters_cache_value_idx
on ttrss_counters_cache(value);
92 create table ttrss_cat_counters_cache (
93 feed_id
integer not null,
94 owner_uid
integer not null,
95 value integer not null default 0,
96 updated datetime
not null,
97 foreign key (owner_uid
) references ttrss_users(id) ON DELETE CASCADE
100 create index ttrss_cat_counters_cache_owner_uid_idx
on ttrss_cat_counters_cache(owner_uid
);
102 create table ttrss_feeds (id integer not null auto_increment
primary key,
103 owner_uid
integer not null,
104 title
varchar(200) not null,
105 cat_id
integer default null,
106 feed_url
text not null,
107 icon_url
varchar(250) not null default '',
108 update_interval
integer not null default 0,
109 purge_interval
integer not null default 0,
110 last_updated datetime
default 0,
111 last_error
varchar(250) not null default '',
112 favicon_avg_color
varchar(11) default null,
113 site_url
varchar(250) not null default '',
114 auth_login
varchar(250) not null default '',
115 auth_pass
varchar(250) not null default '',
116 parent_feed
integer default null,
117 private bool
not null default false,
118 rtl_content bool
not null default false,
119 hidden bool
not null default false,
120 include_in_digest
boolean not null default true,
121 cache_images
boolean not null default false,
122 hide_images
boolean not null default false,
123 cache_content
boolean not null default false,
124 auth_pass_encrypted
boolean not null default false,
125 last_viewed datetime
default null,
126 last_update_started datetime
default null,
127 always_display_enclosures
boolean not null default false,
128 update_method
integer not null default 0,
129 order_id
integer not null default 0,
130 mark_unread_on_update
boolean not null default false,
131 update_on_checksum_change
boolean not null default false,
132 strip_images
boolean not null default false,
133 view_settings
varchar(250) not null default '',
134 pubsub_state
integer not null default 0,
135 favicon_last_checked datetime
default null,
137 foreign key (owner_uid
) references ttrss_users(id) ON DELETE CASCADE,
139 foreign key (cat_id
) references ttrss_feed_categories(id) ON DELETE SET NULL,
141 foreign key (parent_feed
) references ttrss_feeds(id) ON DELETE SET NULL) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
143 create index ttrss_feeds_owner_uid_index
on ttrss_feeds(owner_uid
);
144 create index ttrss_feeds_cat_id_idx
on ttrss_feeds(cat_id
);
146 insert into ttrss_feeds (owner_uid
, title
, feed_url
) values
147 (1, 'Tiny Tiny RSS: New Releases', 'http://tt-rss.org/releases.rss');
149 insert into ttrss_feeds (owner_uid
, title
, feed_url
) values
150 (1, 'Tiny Tiny RSS: Forum', 'http://tt-rss.org/forum/rss.php');
152 create table ttrss_entries (id integer not null primary key auto_increment
,
154 guid
varchar(255) not null unique,
156 updated datetime
not null,
157 content longtext
not null,
158 content_hash
varchar(250) not null,
159 cached_content longtext
,
160 no_orig_date bool
not null default 0,
161 date_entered datetime
not null,
162 date_updated datetime
not null,
163 num_comments
integer not null default 0,
164 plugin_data longtext
,
165 comments varchar(250) not null default '',
166 author
varchar(250) not null default '') ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
168 create index ttrss_entries_date_entered_index
on ttrss_entries(date_entered
);
169 create index ttrss_entries_guid_index
on ttrss_entries(guid
);
170 create index ttrss_entries_updated_idx
on ttrss_entries(updated
);
172 create table ttrss_user_entries (
173 int_id
integer not null primary key auto_increment
,
174 ref_id
integer not null,
175 uuid
varchar(200) not null,
178 owner_uid
integer not null,
179 marked bool
not null default 0,
180 published bool
not null default 0,
181 tag_cache
text not null,
182 label_cache
text not null,
184 score
int not null default 0,
186 last_marked datetime
,
187 last_published datetime
,
188 unread bool
not null default 1,
190 foreign key (ref_id
) references ttrss_entries(id) ON DELETE CASCADE,
192 foreign key (feed_id
) references ttrss_feeds(id) ON DELETE CASCADE,
193 index (orig_feed_id
),
194 foreign key (orig_feed_id
) references ttrss_archived_feeds(id) ON DELETE SET NULL,
196 foreign key (owner_uid
) references ttrss_users(id) ON DELETE CASCADE) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
198 create index ttrss_user_entries_owner_uid_index
on ttrss_user_entries(owner_uid
);
199 create index ttrss_user_entries_ref_id_index
on ttrss_user_entries(ref_id
);
200 create index ttrss_user_entries_feed_id
on ttrss_user_entries(feed_id
);
201 create index ttrss_user_entries_unread_idx
on ttrss_user_entries(unread
);
203 create table ttrss_entry_comments (id integer not null primary key,
204 ref_id
integer not null,
205 owner_uid
integer not null,
206 private bool
not null default 0,
207 date_entered datetime
not null,
209 foreign key (ref_id
) references ttrss_entries(id) ON DELETE CASCADE,
211 foreign key (owner_uid
) references ttrss_users(id) ON DELETE CASCADE) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
213 create table ttrss_filter_types (id integer primary key,
214 name varchar(120) unique not null,
215 description
varchar(250) not null unique) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
217 insert into ttrss_filter_types (id,name,description
) values (1, 'title', 'Title');
218 insert into ttrss_filter_types (id,name,description
) values (2, 'content', 'Content');
219 insert into ttrss_filter_types (id,name,description
) values (3, 'both',
221 insert into ttrss_filter_types (id,name,description
) values (4, 'link',
223 insert into ttrss_filter_types (id,name,description
) values (5, 'date',
225 insert into ttrss_filter_types (id,name,description
) values (6, 'author', 'Author');
226 insert into ttrss_filter_types (id,name,description
) values (7, 'tag', 'Article Tags');
228 create table ttrss_filter_actions (id integer not null primary key,
229 name varchar(120) unique not null,
230 description
varchar(250) not null unique) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
232 insert into ttrss_filter_actions (id,name,description
) values (1, 'filter',
235 insert into ttrss_filter_actions (id,name,description
) values (2, 'catchup',
238 insert into ttrss_filter_actions (id,name,description
) values (3, 'mark',
241 insert into ttrss_filter_actions (id,name,description
) values (4, 'tag',
244 insert into ttrss_filter_actions (id,name,description
) values (5, 'publish',
247 insert into ttrss_filter_actions (id,name,description
) values (6, 'score',
250 insert into ttrss_filter_actions (id,name,description
) values (7, 'label',
253 insert into ttrss_filter_actions (id,name,description
) values (8, 'stop',
254 'Stop / Do nothing');
256 create table ttrss_filters2(id integer primary key auto_increment
,
257 owner_uid
integer not null,
258 match_any_rule
boolean not null default false,
259 enabled
boolean not null default true,
260 inverse bool
not null default false,
261 title
varchar(250) not null default '',
262 order_id
integer not null default 0,
264 foreign key (owner_uid
) references ttrss_users(id) ON DELETE CASCADE) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
266 create table ttrss_filters2_rules(id integer primary key auto_increment
,
267 filter_id
integer not null references ttrss_filters2(id) on delete cascade,
268 reg_exp
varchar(250) not null,
269 inverse bool
not null default false,
270 filter_type
integer not null,
271 feed_id
integer default null,
272 cat_id
integer default null,
273 cat_filter
boolean not null default false,
275 foreign key (filter_id
) references ttrss_filters2(id) on delete cascade,
277 foreign key (filter_type
) references ttrss_filter_types(id) ON DELETE CASCADE,
279 foreign key (feed_id
) references ttrss_feeds(id) ON DELETE CASCADE,
281 foreign key (cat_id
) references ttrss_feed_categories(id) ON DELETE CASCADE) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
283 create table ttrss_filters2_actions(id integer primary key auto_increment
,
284 filter_id
integer not null,
285 action_id
integer not null default 1 references ttrss_filter_actions(id) on delete cascade,
286 action_param
varchar(250) not null default '',
288 foreign key (filter_id
) references ttrss_filters2(id) on delete cascade,
290 foreign key (action_id
) references ttrss_filter_actions(id) ON DELETE CASCADE) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
292 create table ttrss_tags (id integer primary key auto_increment
,
293 owner_uid
integer not null,
294 tag_name
varchar(250) not null,
295 post_int_id
integer not null,
297 foreign key (post_int_id
) references ttrss_user_entries(int_id
) ON DELETE CASCADE,
299 foreign key (owner_uid
) references ttrss_users(id) ON DELETE CASCADE) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
301 create table ttrss_version (schema_version
int not null) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
303 insert into ttrss_version
values (118);
305 create table ttrss_enclosures (id integer primary key auto_increment
,
306 content_url
text not null,
307 content_type
varchar(250) not null,
308 post_id
integer not null,
310 duration
text not null,
312 foreign key (post_id
) references ttrss_entries(id) ON DELETE cascade) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
314 create index ttrss_enclosures_post_id_idx
on ttrss_enclosures(post_id
);
316 create table ttrss_settings_profiles(id integer primary key auto_increment
,
317 title
varchar(250) not null,
318 owner_uid
integer not null,
320 foreign key (owner_uid
) references ttrss_users(id) ON DELETE CASCADE) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
322 create table ttrss_prefs_types (id integer not null primary key,
323 type_name
varchar(100) not null) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
325 insert into ttrss_prefs_types (id, type_name
) values (1, 'bool');
326 insert into ttrss_prefs_types (id, type_name
) values (2, 'string');
327 insert into ttrss_prefs_types (id, type_name
) values (3, 'integer');
329 create table ttrss_prefs_sections (id integer not null primary key,
330 order_id
integer not null) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
332 insert into ttrss_prefs_sections (id, order_id
) values (1, 0);
333 insert into ttrss_prefs_sections (id, order_id
) values (2, 1);
334 insert into ttrss_prefs_sections (id, order_id
) values (3, 3);
335 insert into ttrss_prefs_sections (id, order_id
) values (4, 2);
337 create table ttrss_prefs (pref_name
varchar(250) not null primary key,
338 type_id
integer not null,
339 section_id
integer not null default 1,
340 access_level
integer not null default 0,
341 def_value
text not null,
343 foreign key (type_id
) references ttrss_prefs_types(id),
345 foreign key (section_id
) references ttrss_prefs_sections(id)) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
347 create index ttrss_prefs_pref_name_idx
on ttrss_prefs(pref_name
);
349 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('PURGE_OLD_DAYS', 3, '60', 1);
350 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('DEFAULT_UPDATE_INTERVAL', 3, '30', 1);
351 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('DEFAULT_ARTICLE_LIMIT', 3, '30', 2);
352 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('ALLOW_DUPLICATE_POSTS', 1, 'false', 1);
353 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('ENABLE_FEED_CATS', 1, 'true', 2);
354 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('SHOW_CONTENT_PREVIEW', 1, 'true', 2);
355 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('SHORT_DATE_FORMAT', 2, 'M d, G:i', 3);
356 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('LONG_DATE_FORMAT', 2, 'D, M d Y - G:i', 3);
357 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('COMBINED_DISPLAY_MODE', 1, 'true', 2);
358 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('HIDE_READ_FEEDS', 1, 'false', 2);
359 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('ON_CATCHUP_SHOW_NEXT_FEED', 1, 'false', 2);
360 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('FEEDS_SORT_BY_UNREAD', 1, 'false', 2);
361 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('REVERSE_HEADLINES', 1, 'false', 2);
362 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('DIGEST_ENABLE', 1, 'false', 4);
363 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('CONFIRM_FEED_CATCHUP', 1, 'true', 2);
364 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('CDM_AUTO_CATCHUP', 1, 'false', 2);
365 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('_DEFAULT_VIEW_MODE', 2, 'adaptive', 1);
366 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('_DEFAULT_VIEW_LIMIT', 3, '30', 1);
367 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('_PREFS_ACTIVE_TAB', 2, '', 1);
368 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('STRIP_UNSAFE_TAGS', 1, 'true', 3);
369 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('BLACKLISTED_TAGS', 2, 'main, generic, misc, uncategorized, blog, blogroll, general, news', 3);
370 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('FRESH_ARTICLE_MAX_AGE', 3, '24', 2);
371 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('DIGEST_CATCHUP', 1, 'false', 4);
372 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('CDM_EXPANDED', 1, 'true', 2);
373 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('PURGE_UNREAD_ARTICLES', 1, 'true', 3);
374 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('HIDE_READ_SHOWS_SPECIAL', 1, 'true', 2);
375 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('VFEED_GROUP_BY_FEED', 1, 'false', 2);
376 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('STRIP_IMAGES', 1, 'false', 2);
377 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('_DEFAULT_VIEW_ORDER_BY', 2, 'default', 1);
378 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('ENABLE_API_ACCESS', 1, 'false', 1);
379 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('_COLLAPSED_SPECIAL', 1, 'false', 1);
380 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('_COLLAPSED_LABELS', 1, 'false', 1);
381 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('_COLLAPSED_UNCAT', 1, 'false', 1);
382 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('_COLLAPSED_FEEDLIST', 1, 'false', 1);
383 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('_MOBILE_ENABLE_CATS', 1, 'false', 1);
384 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('_MOBILE_SHOW_IMAGES', 1, 'false', 1);
385 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('_MOBILE_HIDE_READ', 1, 'false', 1);
386 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('_MOBILE_SORT_FEEDS_UNREAD', 1, 'false', 1);
387 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('_THEME_ID', 2, '0', 1);
388 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('USER_TIMEZONE', 2, 'UTC', 1);
389 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('USER_STYLESHEET', 2, '', 2);
390 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('SORT_HEADLINES_BY_FEED_DATE', 1, 'false', 2);
391 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('_MOBILE_BROWSE_CATS', 1, 'true', 1);
392 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('SSL_CERT_SERIAL', 2, '', 3);
393 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('DIGEST_PREFERRED_TIME', 2, '00:00', 4);
394 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('_PREFS_SHOW_EMPTY_CATS', 1, 'false', 1);
395 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('_DEFAULT_INCLUDE_CHILDREN', 1, 'false', 1);
396 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('AUTO_ASSIGN_LABELS', 1, 'true', 3);
397 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('_ENABLED_PLUGINS', 2, '', 1);
398 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('_MOBILE_REVERSE_HEADLINES', 1, 'false', 1);
399 insert into ttrss_prefs (pref_name
,type_id
,def_value
,section_id
) values('USER_CSS_THEME', 2, '', 2);
401 update ttrss_prefs
set access_level
= 1 where pref_name
in ('ON_CATCHUP_SHOW_NEXT_FEED',
402 'SORT_HEADLINES_BY_FEED_DATE',
403 'VFEED_GROUP_BY_FEED',
404 'FRESH_ARTICLE_MAX_AGE',
406 'SHOW_CONTENT_PREVIEW',
407 'AUTO_ASSIGN_LABELS',
408 'HIDE_READ_SHOWS_SPECIAL');
410 create table ttrss_user_prefs (
411 owner_uid
integer not null,
412 pref_name
varchar(250),
413 value longtext
not null,
416 foreign key (profile
) references ttrss_settings_profiles(id) ON DELETE CASCADE,
418 foreign key (owner_uid
) references ttrss_users(id) ON DELETE CASCADE,
420 foreign key (pref_name
) references ttrss_prefs(pref_name
) ON DELETE CASCADE) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
422 create index ttrss_user_prefs_owner_uid_index
on ttrss_user_prefs(owner_uid
);
423 create index ttrss_user_prefs_pref_name_idx
on ttrss_user_prefs(pref_name
);
425 create table ttrss_sessions (id varchar(250) unique not null primary key,
427 expire
integer not null,
429 index (expire
)) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
431 create table ttrss_feedbrowser_cache (
432 feed_url
text not null,
433 site_url
text not null,
435 subscribers
integer not null) DEFAULT CHARSET
=UTF8
;
437 create table ttrss_labels2 (id integer not null primary key auto_increment
,
438 owner_uid
integer not null,
439 caption
varchar(250) not null,
440 fg_color
varchar(15) not null default '',
441 bg_color
varchar(15) not null default '',
442 foreign key (owner_uid
) references ttrss_users(id) ON DELETE CASCADE
443 ) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
445 create table ttrss_user_labels2 (label_id
integer not null,
446 article_id
integer not null,
447 foreign key (label_id
) references ttrss_labels2(id) ON DELETE CASCADE,
448 foreign key (article_id
) references ttrss_entries(id) ON DELETE CASCADE
449 ) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
451 create table ttrss_access_keys (id integer not null primary key auto_increment
,
452 access_key
varchar(250) not null,
453 feed_id
varchar(250) not null,
454 is_cat bool
not null default false,
455 owner_uid
integer not null,
456 foreign key (owner_uid
) references ttrss_users(id) ON DELETE CASCADE) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
458 create table ttrss_linked_instances (id integer not null primary key auto_increment
,
459 last_connected datetime
not null,
460 last_status_in
integer not null,
461 last_status_out
integer not null,
462 access_key
varchar(250) not null unique,
463 access_url
text not null) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
465 create table ttrss_linked_feeds (
466 feed_url
text not null,
467 site_url
text not null,
469 created datetime
not null,
470 updated datetime
not null,
471 instance_id
integer not null,
472 subscribers
integer not null,
473 foreign key (instance_id
) references ttrss_linked_instances(id) ON DELETE CASCADE) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
475 create table ttrss_plugin_storage (
476 id integer not null auto_increment
primary key,
477 name varchar(100) not null,
478 owner_uid
integer not null,
479 content longtext
not null,
480 foreign key (owner_uid
) references ttrss_users(id) ON DELETE CASCADE) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;
482 create table ttrss_error_log(
483 id integer not null auto_increment
primary key,
485 errno
integer not null,
486 errstr
text not null,
487 filename
text not null,
488 lineno
integer not null,
489 context
text not null,
490 created_at datetime
not null,
491 foreign key (owner_uid
) references ttrss_users(id) ON DELETE SET NULL) ENGINE
=InnoDB
DEFAULT CHARSET
=UTF8
;