1 drop table if exists ttrss_linked_feeds
;
2 drop table if exists ttrss_linked_instances
;
3 drop table if exists ttrss_access_keys
;
4 drop table if exists ttrss_user_labels2
;
5 drop table if exists ttrss_labels2
;
6 drop table if exists ttrss_feedbrowser_cache
;
7 drop table if exists ttrss_version
;
8 drop table if exists ttrss_labels
;
9 drop table if exists ttrss_filters2_rules
;
10 drop table if exists ttrss_filters2_actions
;
11 drop table if exists ttrss_filters2
;
12 drop table if exists ttrss_filters
;
13 drop table if exists ttrss_filter_types
;
14 drop table if exists ttrss_filter_actions
;
15 drop table if exists ttrss_user_prefs
;
16 drop table if exists ttrss_prefs
;
17 drop table if exists ttrss_prefs_types
;
18 drop table if exists ttrss_prefs_sections
;
19 drop table if exists ttrss_tags
;
20 drop table if exists ttrss_enclosures
;
21 drop table if exists ttrss_settings_profiles
;
22 drop table if exists ttrss_entry_comments
;
23 drop table if exists ttrss_user_entries
;
24 drop table if exists ttrss_entries
;
25 drop table if exists ttrss_scheduled_updates
;
26 drop table if exists ttrss_counters_cache
;
27 drop table if exists ttrss_cat_counters_cache
;
28 drop table if exists ttrss_archived_feeds
;
29 drop table if exists ttrss_feeds
;
30 drop table if exists ttrss_feed_categories
;
31 drop table if exists ttrss_users
;
32 drop table if exists ttrss_themes
;
33 drop table if exists ttrss_sessions
;
34 drop function if exists SUBSTRING_FOR_DATE(timestamp, int, int);
38 create table ttrss_users (id serial
not null primary key,
39 login varchar(120) not null unique,
40 pwd_hash
varchar(250) not null,
41 last_login
timestamp default null,
42 access_level
integer not null default 0,
43 email
varchar(250) not null default '',
44 full_name
varchar(250) not null default '',
45 email_digest
boolean not null default false,
46 last_digest_sent
timestamp default null,
47 salt
varchar(250) not null default '',
48 twitter_oauth
text default null,
49 otp_enabled
boolean not null default false,
50 created
timestamp default null);
52 insert into ttrss_users (login,pwd_hash
,access_level
) values ('admin',
53 'SHA1:5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 10);
55 create table ttrss_feed_categories(id serial
not null primary key,
56 owner_uid
integer not null references ttrss_users(id) on delete cascade,
57 collapsed
boolean not null default false,
58 order_id
integer not null default 0,
59 parent_cat
integer references ttrss_feed_categories(id) on delete set null,
60 title
varchar(200) not null);
62 create table ttrss_feeds (id serial
not null primary key,
63 owner_uid
integer not null references ttrss_users(id) on delete cascade,
64 title
varchar(200) not null,
65 cat_id
integer default null references ttrss_feed_categories(id) on delete set null,
66 feed_url
text not null,
67 icon_url
varchar(250) not null default '',
68 update_interval
integer not null default 0,
69 purge_interval
integer not null default 0,
70 last_updated
timestamp default null,
71 last_error
text not null default '',
72 site_url
varchar(250) not null default '',
73 auth_login
varchar(250) not null default '',
74 parent_feed
integer default null references ttrss_feeds(id) on delete set null,
75 private
boolean not null default false,
76 auth_pass
varchar(250) not null default '',
77 hidden
boolean not null default false,
78 include_in_digest
boolean not null default true,
79 rtl_content
boolean not null default false,
80 cache_images
boolean not null default false,
81 last_viewed
timestamp default null,
82 last_update_started
timestamp default null,
83 update_method
integer not null default 0,
84 always_display_enclosures
boolean not null default false,
85 order_id
integer not null default 0,
86 mark_unread_on_update
boolean not null default false,
87 update_on_checksum_change
boolean not null default false,
88 strip_images
boolean not null default false,
89 pubsub_state
integer not null default 0,
90 favicon_last_checked
timestamp default null,
91 auth_pass_encrypted
boolean not null default false);
93 create index ttrss_feeds_owner_uid_index
on ttrss_feeds(owner_uid
);
94 create index ttrss_feeds_cat_id_idx
on ttrss_feeds(cat_id
);
96 insert into ttrss_feeds (owner_uid
, title
, feed_url
) values
97 (1, 'Tiny Tiny RSS: New Releases', 'http://tt-rss.org/releases.rss');
99 insert into ttrss_feeds (owner_uid
, title
, feed_url
) values
100 (1, 'Tiny Tiny RSS: Forum', 'http://tt-rss.org/forum/rss.php');
102 create table ttrss_archived_feeds (id integer not null primary key,
103 owner_uid
integer not null references ttrss_users(id) on delete cascade,
104 title
varchar(200) not null,
105 feed_url
text not null,
106 site_url
varchar(250) not null default '');
108 create table ttrss_counters_cache (
109 feed_id
integer not null,
110 owner_uid
integer not null references ttrss_users(id) ON DELETE CASCADE,
111 updated
timestamp not null,
112 value integer not null default 0);
114 create index ttrss_counters_cache_feed_id_idx
on ttrss_counters_cache(feed_id
);
115 create index ttrss_counters_cache_owner_uid_idx
on ttrss_counters_cache(owner_uid
);
116 create index ttrss_counters_cache_value_idx
on ttrss_counters_cache(value);
118 create table ttrss_cat_counters_cache (
119 feed_id
integer not null,
120 owner_uid
integer not null references ttrss_users(id) ON DELETE CASCADE,
121 updated
timestamp not null,
122 value integer not null default 0);
124 create index ttrss_cat_counters_cache_owner_uid_idx
on ttrss_cat_counters_cache(owner_uid
);
126 create table ttrss_entries (id serial
not null primary key,
128 guid
text not null unique,
130 updated
timestamp not null,
131 content text not null,
132 content_hash
varchar(250) not null,
133 no_orig_date
boolean not null default false,
134 date_entered
timestamp not null,
135 date_updated
timestamp not null,
136 num_comments
integer not null default 0,
137 comments varchar(250) not null default '',
138 author
varchar(250) not null default '');
140 create index ttrss_entries_guid_index
on ttrss_entries(guid
);
141 -- create index ttrss_entries_title_index on ttrss_entries(title);
142 create index ttrss_entries_date_entered_index
on ttrss_entries(date_entered
);
143 create index ttrss_entries_updated_idx
on ttrss_entries(updated
);
145 create table ttrss_user_entries (
146 int_id serial
not null primary key,
147 ref_id
integer not null references ttrss_entries(id) ON DELETE CASCADE,
148 uuid
varchar(200) not null,
149 feed_id
int references ttrss_feeds(id) ON DELETE CASCADE,
150 orig_feed_id
integer references ttrss_archived_feeds(id) ON DELETE SET NULL,
151 owner_uid
integer not null references ttrss_users(id) ON DELETE CASCADE,
152 marked
boolean not null default false,
153 published
boolean not null default false,
154 tag_cache
text not null,
155 label_cache
text not null,
157 score
int not null default 0,
159 unread
boolean not null default true);
161 -- create index ttrss_user_entries_feed_id_index on ttrss_user_entries(feed_id);
162 create index ttrss_user_entries_owner_uid_index
on ttrss_user_entries(owner_uid
);
163 create index ttrss_user_entries_ref_id_index
on ttrss_user_entries(ref_id
);
164 create index ttrss_user_entries_feed_id
on ttrss_user_entries(feed_id
);
165 create index ttrss_user_entries_unread_idx
on ttrss_user_entries(unread
);
167 create table ttrss_entry_comments (id serial
not null primary key,
168 ref_id
integer not null references ttrss_entries(id) ON DELETE CASCADE,
169 owner_uid
integer not null references ttrss_users(id) ON DELETE CASCADE,
170 private
boolean not null default false,
171 date_entered
timestamp not null);
173 create index ttrss_entry_comments_ref_id_index
on ttrss_entry_comments(ref_id
);
174 -- create index ttrss_entry_comments_owner_uid_index on ttrss_entry_comments(owner_uid);
176 create table ttrss_filter_types (id integer not null primary key,
177 name varchar(120) unique not null,
178 description
varchar(250) not null unique);
180 insert into ttrss_filter_types (id,name,description
) values (1, 'title', 'Title');
181 insert into ttrss_filter_types (id,name,description
) values (2, 'content', 'Content');
182 insert into ttrss_filter_types (id,name,description
) values (3, 'both',
184 insert into ttrss_filter_types (id,name,description
) values (4, 'link',
186 insert into ttrss_filter_types (id,name,description
) values (5, 'date',
188 insert into ttrss_filter_types (id,name,description
) values (6, 'author', 'Author');
189 insert into ttrss_filter_types (id,name,description
) values (7, 'tag', 'Article Tags');
191 create table ttrss_filter_actions (id integer not null primary key,
192 name varchar(120) unique not null,
193 description
varchar(250) not null unique);
195 insert into ttrss_filter_actions (id,name,description
) values (1, 'filter',
198 insert into ttrss_filter_actions (id,name,description
) values (2, 'catchup',
201 insert into ttrss_filter_actions (id,name,description
) values (3, 'mark',
204 insert into ttrss_filter_actions (id,name,description
) values (4, 'tag',
207 insert into ttrss_filter_actions (id,name,description
) values (5, 'publish',
210 insert into ttrss_filter_actions (id,name,description
) values (6, 'score',
213 insert into ttrss_filter_actions (id,name,description
) values (7, 'label',
216 create table ttrss_filters (id serial
not null primary key,
217 owner_uid
integer not null references ttrss_users(id) on delete cascade,
218 feed_id
integer references ttrss_feeds(id) on delete cascade default null,
219 filter_type
integer not null references ttrss_filter_types(id),
220 reg_exp
varchar(250) not null,
221 filter_param
varchar(250) not null default '',
222 enabled
boolean not null default true,
223 inverse
boolean not null default false,
224 cat_filter
boolean not null default false,
225 cat_id
integer references ttrss_feed_categories(id) on delete cascade default null,
226 action_id
integer not null default 1 references ttrss_filter_actions(id) on delete cascade,
227 action_param
varchar(250) not null default '');
229 create table ttrss_filters2(id serial
not null primary key,
230 owner_uid
integer not null references ttrss_users(id) on delete cascade,
231 match_any_rule
boolean not null default false,
232 enabled
boolean not null default true);
234 create table ttrss_filters2_rules(id serial
not null primary key,
235 filter_id
integer not null references ttrss_filters2(id) on delete cascade,
236 reg_exp
varchar(250) not null,
237 filter_type
integer not null references ttrss_filter_types(id),
238 feed_id
integer references ttrss_feeds(id) on delete cascade default null,
239 cat_id
integer references ttrss_feed_categories(id) on delete cascade default null,
240 cat_filter
boolean not null default false);
242 create table ttrss_filters2_actions(id serial
not null primary key,
243 filter_id
integer not null references ttrss_filters2(id) on delete cascade,
244 action_id
integer not null default 1 references ttrss_filter_actions(id) on delete cascade,
245 action_param
varchar(250) not null default '');
247 create table ttrss_tags (id serial
not null primary key,
248 tag_name
varchar(250) not null,
249 owner_uid
integer not null references ttrss_users(id) on delete cascade,
250 post_int_id
integer references ttrss_user_entries(int_id
) ON DELETE CASCADE not null);
252 create index ttrss_tags_owner_uid_index
on ttrss_tags(owner_uid
);
253 create index ttrss_tags_post_int_id_idx
on ttrss_tags(post_int_id
);
255 create table ttrss_version (schema_version
int not null);
257 insert into ttrss_version
values (97);
259 create table ttrss_enclosures (id serial
not null primary key,
260 content_url
text not null,
261 content_type
varchar(250) not null,
263 duration
text not null,
264 post_id
integer references ttrss_entries(id) ON DELETE cascade NOT NULL);
266 create index ttrss_enclosures_post_id_idx
on ttrss_enclosures(post_id
);
268 create table ttrss_settings_profiles(id serial
not null primary key,
269 title
varchar(250) not null,
270 owner_uid
integer not null references ttrss_users(id) on delete cascade);
272 create table ttrss_prefs_types (id integer not null primary key,
273 type_name
varchar(100) not null);
275 insert into ttrss_prefs_types (id, type_name
) values (1, 'bool');
276 insert into ttrss_prefs_types (id, type_name
) values (2, 'string');
277 insert into ttrss_prefs_types (id, type_name
) values (3, 'integer');
279 create table ttrss_prefs_sections (id integer not null primary key,
280 order_id
integer not null,
281 section_name
varchar(100) not null);
283 insert into ttrss_prefs_sections (id, section_name
, order_id
) values (1, 'General', 0);
284 insert into ttrss_prefs_sections (id, section_name
, order_id
) values (2, 'Interface', 1);
285 insert into ttrss_prefs_sections (id, section_name
, order_id
) values (3, 'Advanced', 3);
286 insert into ttrss_prefs_sections (id, section_name
, order_id
) values (4, 'Digest', 2);
288 create table ttrss_prefs (pref_name
varchar(250) not null primary key,
289 type_id
integer not null references ttrss_prefs_types(id),
290 section_id
integer not null default 1 references ttrss_prefs_sections(id),
291 short_desc
text not null,
292 help_text
varchar(250) not null default '',
293 access_level
integer not null default 0,
294 def_value
text not null);
296 create index ttrss_prefs_pref_name_idx
on ttrss_prefs(pref_name
);
298 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);
300 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);
302 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);
304 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.');
306 insert into ttrss_prefs (pref_name
,type_id
,def_value
,short_desc
,section_id
) values('ENABLE_FEED_CATS', 1, 'true', 'Enable feed categories',2);
308 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);
310 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);
311 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);
313 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');
315 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);
317 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');
319 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);
321 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);
323 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');
325 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);
327 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.');
329 insert into ttrss_prefs (pref_name
,type_id
,def_value
,short_desc
,section_id
) values('_DEFAULT_VIEW_MODE', 2, 'adaptive', '', 1);
331 insert into ttrss_prefs (pref_name
,type_id
,def_value
,short_desc
,section_id
) values('_DEFAULT_VIEW_LIMIT', 3, '30', '', 1);
333 insert into ttrss_prefs (pref_name
,type_id
,def_value
,short_desc
,section_id
) values('_PREFS_ACTIVE_TAB', 2, '', '', 1);
335 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.');
337 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).');
339 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);
341 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);
343 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);
345 insert into ttrss_prefs (pref_name
,type_id
,def_value
,short_desc
,section_id
) values('PURGE_UNREAD_ARTICLES', 1, 'true', 'Purge unread articles',3);
347 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);
349 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');
351 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);
353 insert into ttrss_prefs (pref_name
,type_id
,def_value
,short_desc
,section_id
) values('_DEFAULT_VIEW_ORDER_BY', 2, 'default', '', 1);
355 insert into ttrss_prefs (pref_name
,type_id
,def_value
,short_desc
,section_id
) values('ENABLE_API_ACCESS', 1, 'false', 'Enable external API', 1);
357 insert into ttrss_prefs (pref_name
,type_id
,def_value
,short_desc
,section_id
) values('_COLLAPSED_SPECIAL', 1, 'false', '', 1);
359 insert into ttrss_prefs (pref_name
,type_id
,def_value
,short_desc
,section_id
) values('_COLLAPSED_LABELS', 1, 'false', '', 1);
361 insert into ttrss_prefs (pref_name
,type_id
,def_value
,short_desc
,section_id
) values('_COLLAPSED_UNCAT', 1, 'false', '', 1);
363 insert into ttrss_prefs (pref_name
,type_id
,def_value
,short_desc
,section_id
) values('_COLLAPSED_FEEDLIST', 1, 'false', '', 1);
365 insert into ttrss_prefs (pref_name
,type_id
,def_value
,short_desc
,section_id
) values('_MOBILE_ENABLE_CATS', 1, 'false', '', 1);
367 insert into ttrss_prefs (pref_name
,type_id
,def_value
,short_desc
,section_id
) values('_MOBILE_SHOW_IMAGES', 1, 'false', '', 1);
369 insert into ttrss_prefs (pref_name
,type_id
,def_value
,short_desc
,section_id
) values('_MOBILE_HIDE_READ', 1, 'false', '', 1);
371 insert into ttrss_prefs (pref_name
,type_id
,def_value
,short_desc
,section_id
) values('_MOBILE_SORT_FEEDS_UNREAD', 1, 'false', '', 1);
373 insert into ttrss_prefs (pref_name
,type_id
,def_value
,short_desc
,section_id
) values('_THEME_ID', 2, '0', '', 1);
375 insert into ttrss_prefs (pref_name
,type_id
,def_value
,short_desc
,section_id
) values('USER_TIMEZONE', 2, 'UTC', 'User timezone', 1);
377 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');
379 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.');
381 insert into ttrss_prefs (pref_name
,type_id
,def_value
,short_desc
,section_id
) values('_MOBILE_BROWSE_CATS', 1, 'true', '', 1);
383 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');
385 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');
387 insert into ttrss_prefs (pref_name
,type_id
,def_value
,short_desc
,section_id
) values('_PREFS_SHOW_EMPTY_CATS', 1, 'false', '', 1);
389 insert into ttrss_prefs (pref_name
,type_id
,def_value
,short_desc
,section_id
) values('_DEFAULT_INCLUDE_CHILDREN', 1, 'false', '', 1);
391 update ttrss_prefs
set access_level
= 1 where pref_name
in ('ON_CATCHUP_SHOW_NEXT_FEED',
392 'SORT_HEADLINES_BY_FEED_DATE',
393 'VFEED_GROUP_BY_FEED',
394 'FRESH_ARTICLE_MAX_AGE',
396 'SHOW_CONTENT_PREVIEW',
397 'HIDE_READ_SHOWS_SPECIAL');
399 create table ttrss_user_prefs (
400 owner_uid
integer not null references ttrss_users(id) ON DELETE CASCADE,
401 pref_name
varchar(250) not null references ttrss_prefs(pref_name
) ON DELETE CASCADE,
402 profile
integer references ttrss_settings_profiles(id) ON DELETE CASCADE,
403 value text not null);
405 create index ttrss_user_prefs_owner_uid_index
on ttrss_user_prefs(owner_uid
);
406 create index ttrss_user_prefs_pref_name_idx
on ttrss_user_prefs(pref_name
);
407 -- create index ttrss_user_prefs_value_index on ttrss_user_prefs(value);
409 create table ttrss_sessions (id varchar(250) unique not null primary key,
411 expire
integer not null);
413 create index ttrss_sessions_expire_index
on ttrss_sessions(expire
);
415 create function SUBSTRING_FOR_DATE(timestamp, int, int) RETURNS text AS 'SELECT SUBSTRING(CAST($1 AS text), $2, $3)' LANGUAGE 'sql';
417 create table ttrss_feedbrowser_cache (
418 feed_url
text not null primary key,
420 site_url
text not null,
421 subscribers
integer not null);
423 create table ttrss_labels2 (id serial
not null primary key,
424 owner_uid
integer not null references ttrss_users(id) ON DELETE CASCADE,
425 fg_color
varchar(15) not null default '',
426 bg_color
varchar(15) not null default '',
427 caption
varchar(250) not null
430 create table ttrss_user_labels2 (
431 label_id
integer not null references ttrss_labels2(id) ON DELETE CASCADE,
432 article_id
integer not null references ttrss_entries(id) ON DELETE CASCADE
435 create table ttrss_access_keys (id serial
not null primary key,
436 access_key
varchar(250) not null,
437 feed_id
varchar(250) not null,
438 is_cat
boolean not null default false,
439 owner_uid
integer not null references ttrss_users(id) on delete cascade);
441 create table ttrss_linked_instances (id serial
not null primary key,
442 last_connected
timestamp not null,
443 last_status_in
integer not null,
444 last_status_out
integer not null,
445 access_key
varchar(250) not null unique,
446 access_url
text not null);
448 create table ttrss_linked_feeds (
449 feed_url
text not null,
450 site_url
text not null,
452 created
timestamp not null,
453 updated
timestamp not null,
454 instance_id
integer not null references ttrss_linked_instances(id) ON DELETE CASCADE,
455 subscribers
integer not null);