]> git.wh0rd.org - tt-rss.git/blame_incremental - schema/ttrss_schema_mysql.sql
implement per-feed stemming language setting
[tt-rss.git] / schema / ttrss_schema_mysql.sql
... / ...
CommitLineData
1SET NAMES utf8;
2SET CHARACTER SET utf8;
3
4drop table if exists ttrss_error_log;
5drop table if exists ttrss_plugin_storage;
6drop table if exists ttrss_linked_feeds;
7drop table if exists ttrss_linked_instances;
8drop table if exists ttrss_access_keys;
9drop table if exists ttrss_user_labels2;
10drop table if exists ttrss_labels2;
11drop table if exists ttrss_feedbrowser_cache;
12drop table if exists ttrss_version;
13drop table if exists ttrss_labels;
14drop table if exists ttrss_filters2_actions;
15drop table if exists ttrss_filters2_rules;
16drop table if exists ttrss_filters2;
17drop table if exists ttrss_filters;
18drop table if exists ttrss_filter_types;
19drop table if exists ttrss_filter_actions;
20drop table if exists ttrss_user_prefs;
21drop table if exists ttrss_prefs;
22drop table if exists ttrss_prefs_types;
23drop table if exists ttrss_prefs_sections;
24drop table if exists ttrss_tags;
25drop table if exists ttrss_enclosures;
26drop table if exists ttrss_settings_profiles;
27drop table if exists ttrss_entry_comments;
28drop table if exists ttrss_user_entries;
29drop table if exists ttrss_entries;
30drop table if exists ttrss_scheduled_updates;
31drop table if exists ttrss_counters_cache;
32drop table if exists ttrss_cat_counters_cache;
33drop table if exists ttrss_feeds;
34drop table if exists ttrss_archived_feeds;
35drop table if exists ttrss_feed_categories;
36drop table if exists ttrss_users;
37drop table if exists ttrss_themes;
38drop table if exists ttrss_sessions;
39
40begin;
41
42create table ttrss_users (id integer primary key not null auto_increment,
43 login varchar(120) not null unique,
44 pwd_hash varchar(250) not null,
45 last_login datetime default null,
46 access_level integer not null default 0,
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 resetpass_token varchar(250) default null) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
56
57insert into ttrss_users (login,pwd_hash,access_level) values ('admin',
58 'SHA1:5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 10);
59
60create 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,
65 parent_cat integer,
66 view_settings varchar(250) not null default '',
67 foreign key (parent_cat) references ttrss_feed_categories(id) ON DELETE SET NULL,
68 foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
69
70create 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 foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
76
77create table ttrss_counters_cache (
78 feed_id integer not null,
79 owner_uid integer not null,
80 value integer not null default 0,
81 updated datetime not null,
82 foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE
83) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
84
85create index ttrss_counters_cache_feed_id_idx on ttrss_counters_cache(feed_id);
86create index ttrss_counters_cache_value_idx on ttrss_counters_cache(value);
87
88create table ttrss_cat_counters_cache (
89 feed_id integer not null,
90 owner_uid integer not null,
91 value integer not null default 0,
92 updated datetime not null,
93 foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE
94) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
95
96create table ttrss_feeds (id integer not null auto_increment primary key,
97 owner_uid integer not null,
98 title varchar(200) not null,
99 cat_id integer default null,
100 feed_url text not null,
101 icon_url varchar(250) not null default '',
102 update_interval integer not null default 0,
103 purge_interval integer not null default 0,
104 last_updated datetime default 0,
105 last_error varchar(250) not null default '',
106 favicon_avg_color varchar(11) default null,
107 site_url varchar(250) not null default '',
108 auth_login varchar(250) not null default '',
109 auth_pass varchar(250) not null default '',
110 parent_feed integer default null,
111 private bool not null default false,
112 rtl_content bool not null default false,
113 hidden bool not null default false,
114 include_in_digest boolean not null default true,
115 cache_images boolean not null default false,
116 hide_images boolean not null default false,
117 cache_content boolean not null default false,
118 auth_pass_encrypted boolean not null default false,
119 last_viewed datetime default null,
120 last_update_started datetime default null,
121 always_display_enclosures boolean not null default false,
122 update_method integer not null default 0,
123 order_id integer not null default 0,
124 mark_unread_on_update boolean not null default false,
125 update_on_checksum_change boolean not null default false,
126 strip_images boolean not null default false,
127 view_settings varchar(250) not null default '',
128 pubsub_state integer not null default 0,
129 favicon_last_checked datetime default null,
130 feed_language varchar(100) not null default '',
131 foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE,
132 foreign key (cat_id) references ttrss_feed_categories(id) ON DELETE SET NULL,
133 foreign key (parent_feed) references ttrss_feeds(id) ON DELETE SET NULL) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
134
135insert into ttrss_feeds (owner_uid, title, feed_url) values
136 (1, 'Tiny Tiny RSS: Forum', 'http://tt-rss.org/forum/rss.php');
137
138create table ttrss_entries (id integer not null primary key auto_increment,
139 title text not null,
140 guid varchar(255) not null unique,
141 link text not null,
142 updated datetime not null,
143 content longtext not null,
144 content_hash varchar(250) not null,
145 cached_content longtext,
146 no_orig_date bool not null default 0,
147 date_entered datetime not null,
148 date_updated datetime not null,
149 num_comments integer not null default 0,
150 plugin_data longtext,
151 lang varchar(2),
152 comments varchar(250) not null default '',
153 author varchar(250) not null default '') ENGINE=InnoDB DEFAULT CHARSET=UTF8;
154
155create index ttrss_entries_date_entered_index on ttrss_entries(date_entered);
156create index ttrss_entries_updated_idx on ttrss_entries(updated);
157
158create table ttrss_user_entries (
159 int_id integer not null primary key auto_increment,
160 ref_id integer not null,
161 uuid varchar(200) not null,
162 feed_id int,
163 orig_feed_id int,
164 owner_uid integer not null,
165 marked bool not null default 0,
166 published bool not null default 0,
167 tag_cache text not null,
168 label_cache text not null,
169 last_read datetime,
170 score int not null default 0,
171 note longtext,
172 last_marked datetime,
173 last_published datetime,
174 unread bool not null default 1,
175 foreign key (ref_id) references ttrss_entries(id) ON DELETE CASCADE,
176 foreign key (feed_id) references ttrss_feeds(id) ON DELETE CASCADE,
177 foreign key (orig_feed_id) references ttrss_archived_feeds(id) ON DELETE SET NULL,
178 foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
179
180create index ttrss_user_entries_unread_idx on ttrss_user_entries(unread);
181
182create table ttrss_entry_comments (id integer not null primary key,
183 ref_id integer not null,
184 owner_uid integer not null,
185 private bool not null default 0,
186 date_entered datetime not null,
187 index (ref_id),
188 foreign key (ref_id) references ttrss_entries(id) ON DELETE CASCADE,
189 index (owner_uid),
190 foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
191
192create table ttrss_filter_types (id integer primary key,
193 name varchar(120) unique not null,
194 description varchar(250) not null unique) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
195
196insert into ttrss_filter_types (id,name,description) values (1, 'title', 'Title');
197insert into ttrss_filter_types (id,name,description) values (2, 'content', 'Content');
198insert into ttrss_filter_types (id,name,description) values (3, 'both',
199 'Title or Content');
200insert into ttrss_filter_types (id,name,description) values (4, 'link',
201 'Link');
202insert into ttrss_filter_types (id,name,description) values (5, 'date',
203 'Article Date');
204insert into ttrss_filter_types (id,name,description) values (6, 'author', 'Author');
205insert into ttrss_filter_types (id,name,description) values (7, 'tag', 'Article Tags');
206
207create table ttrss_filter_actions (id integer not null primary key,
208 name varchar(120) unique not null,
209 description varchar(250) not null unique) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
210
211insert into ttrss_filter_actions (id,name,description) values (1, 'filter',
212 'Delete article');
213
214insert into ttrss_filter_actions (id,name,description) values (2, 'catchup',
215 'Mark as read');
216
217insert into ttrss_filter_actions (id,name,description) values (3, 'mark',
218 'Set starred');
219
220insert into ttrss_filter_actions (id,name,description) values (4, 'tag',
221 'Assign tags');
222
223insert into ttrss_filter_actions (id,name,description) values (5, 'publish',
224 'Publish article');
225
226insert into ttrss_filter_actions (id,name,description) values (6, 'score',
227 'Modify score');
228
229insert into ttrss_filter_actions (id,name,description) values (7, 'label',
230 'Assign label');
231
232insert into ttrss_filter_actions (id,name,description) values (8, 'stop',
233 'Stop / Do nothing');
234
235create table ttrss_filters2(id integer primary key auto_increment,
236 owner_uid integer not null,
237 match_any_rule boolean not null default false,
238 enabled boolean not null default true,
239 inverse bool not null default false,
240 title varchar(250) not null default '',
241 order_id integer not null default 0,
242 foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
243
244create table ttrss_filters2_rules(id integer primary key auto_increment,
245 filter_id integer not null references ttrss_filters2(id) on delete cascade,
246 reg_exp varchar(250) not null,
247 inverse bool not null default false,
248 filter_type integer not null,
249 feed_id integer default null,
250 cat_id integer default null,
251 cat_filter boolean not null default false,
252 index (filter_id),
253 foreign key (filter_id) references ttrss_filters2(id) on delete cascade,
254 index (filter_type),
255 foreign key (filter_type) references ttrss_filter_types(id) ON DELETE CASCADE,
256 index (feed_id),
257 foreign key (feed_id) references ttrss_feeds(id) ON DELETE CASCADE,
258 index (cat_id),
259 foreign key (cat_id) references ttrss_feed_categories(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
260
261create table ttrss_filters2_actions(id integer primary key auto_increment,
262 filter_id integer not null,
263 action_id integer not null default 1 references ttrss_filter_actions(id) on delete cascade,
264 action_param varchar(250) not null default '',
265 index (filter_id),
266 foreign key (filter_id) references ttrss_filters2(id) on delete cascade,
267 index (action_id),
268 foreign key (action_id) references ttrss_filter_actions(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
269
270create table ttrss_tags (id integer primary key auto_increment,
271 owner_uid integer not null,
272 tag_name varchar(250) not null,
273 post_int_id integer not null,
274 index (post_int_id),
275 foreign key (post_int_id) references ttrss_user_entries(int_id) ON DELETE CASCADE,
276 index (owner_uid),
277 foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
278
279create table ttrss_version (schema_version int not null) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
280
281insert into ttrss_version values (127);
282
283create table ttrss_enclosures (id integer primary key auto_increment,
284 content_url text not null,
285 content_type varchar(250) not null,
286 post_id integer not null,
287 title text not null,
288 duration text not null,
289 width integer not null default 0,
290 height integer not null default 0,
291 foreign key (post_id) references ttrss_entries(id) ON DELETE cascade) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
292
293create table ttrss_settings_profiles(id integer primary key auto_increment,
294 title varchar(250) not null,
295 owner_uid integer not null,
296 index (owner_uid),
297 foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
298
299create table ttrss_prefs_types (id integer not null primary key,
300 type_name varchar(100) not null) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
301
302insert into ttrss_prefs_types (id, type_name) values (1, 'bool');
303insert into ttrss_prefs_types (id, type_name) values (2, 'string');
304insert into ttrss_prefs_types (id, type_name) values (3, 'integer');
305
306create table ttrss_prefs_sections (id integer not null primary key,
307 order_id integer not null) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
308
309insert into ttrss_prefs_sections (id, order_id) values (1, 0);
310insert into ttrss_prefs_sections (id, order_id) values (2, 1);
311insert into ttrss_prefs_sections (id, order_id) values (3, 3);
312insert into ttrss_prefs_sections (id, order_id) values (4, 2);
313
314create table ttrss_prefs (pref_name varchar(250) not null primary key,
315 type_id integer not null,
316 section_id integer not null default 1,
317 access_level integer not null default 0,
318 def_value text not null,
319 foreign key (type_id) references ttrss_prefs_types(id),
320 foreign key (section_id) references ttrss_prefs_sections(id)) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
321
322insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('PURGE_OLD_DAYS', 3, '60', 1);
323insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('DEFAULT_UPDATE_INTERVAL', 3, '30', 1);
324insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('DEFAULT_ARTICLE_LIMIT', 3, '30', 2);
325insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('ALLOW_DUPLICATE_POSTS', 1, 'false', 1);
326insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('ENABLE_FEED_CATS', 1, 'true', 2);
327insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('SHOW_CONTENT_PREVIEW', 1, 'true', 2);
328insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('SHORT_DATE_FORMAT', 2, 'M d, G:i', 3);
329insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('LONG_DATE_FORMAT', 2, 'D, M d Y - G:i', 3);
330insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('COMBINED_DISPLAY_MODE', 1, 'true', 2);
331insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('HIDE_READ_FEEDS', 1, 'false', 2);
332insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('ON_CATCHUP_SHOW_NEXT_FEED', 1, 'false', 2);
333insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('FEEDS_SORT_BY_UNREAD', 1, 'false', 2);
334insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('REVERSE_HEADLINES', 1, 'false', 2);
335insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('DIGEST_ENABLE', 1, 'false', 4);
336insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('CONFIRM_FEED_CATCHUP', 1, 'true', 2);
337insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('CDM_AUTO_CATCHUP', 1, 'false', 2);
338insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_DEFAULT_VIEW_MODE', 2, 'adaptive', 1);
339insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_DEFAULT_VIEW_LIMIT', 3, '30', 1);
340insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_PREFS_ACTIVE_TAB', 2, '', 1);
341insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('STRIP_UNSAFE_TAGS', 1, 'true', 3);
342insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('BLACKLISTED_TAGS', 2, 'main, generic, misc, uncategorized, blog, blogroll, general, news', 3);
343insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('FRESH_ARTICLE_MAX_AGE', 3, '24', 2);
344insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('DIGEST_CATCHUP', 1, 'false', 4);
345insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('CDM_EXPANDED', 1, 'true', 2);
346insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('PURGE_UNREAD_ARTICLES', 1, 'true', 3);
347insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('HIDE_READ_SHOWS_SPECIAL', 1, 'true', 2);
348insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('VFEED_GROUP_BY_FEED', 1, 'false', 2);
349insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('STRIP_IMAGES', 1, 'false', 2);
350insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_DEFAULT_VIEW_ORDER_BY', 2, 'default', 1);
351insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('ENABLE_API_ACCESS', 1, 'false', 1);
352insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_COLLAPSED_SPECIAL', 1, 'false', 1);
353insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_COLLAPSED_LABELS', 1, 'false', 1);
354insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_COLLAPSED_UNCAT', 1, 'false', 1);
355insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_COLLAPSED_FEEDLIST', 1, 'false', 1);
356insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_MOBILE_ENABLE_CATS', 1, 'false', 1);
357insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_MOBILE_SHOW_IMAGES', 1, 'false', 1);
358insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_MOBILE_HIDE_READ', 1, 'false', 1);
359insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_MOBILE_SORT_FEEDS_UNREAD', 1, 'false', 1);
360insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_THEME_ID', 2, '0', 1);
361insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('USER_TIMEZONE', 2, 'Automatic', 1);
362insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('USER_STYLESHEET', 2, '', 2);
363insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('SORT_HEADLINES_BY_FEED_DATE', 1, 'false', 2);
364insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_MOBILE_BROWSE_CATS', 1, 'true', 1);
365insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('SSL_CERT_SERIAL', 2, '', 3);
366insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('DIGEST_PREFERRED_TIME', 2, '00:00', 4);
367insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_PREFS_SHOW_EMPTY_CATS', 1, 'false', 1);
368insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_DEFAULT_INCLUDE_CHILDREN', 1, 'false', 1);
369insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('AUTO_ASSIGN_LABELS', 1, 'false', 3);
370insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_ENABLED_PLUGINS', 2, '', 1);
371insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_MOBILE_REVERSE_HEADLINES', 1, 'false', 1);
372insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('USER_CSS_THEME', 2, '', 2);
373insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('USER_LANGUAGE', 2, '', 2);
374
375update ttrss_prefs set access_level = 1 where pref_name in ('ON_CATCHUP_SHOW_NEXT_FEED',
376 'SORT_HEADLINES_BY_FEED_DATE',
377 'VFEED_GROUP_BY_FEED',
378 'FRESH_ARTICLE_MAX_AGE',
379 'CDM_EXPANDED',
380 'SHOW_CONTENT_PREVIEW',
381 'AUTO_ASSIGN_LABELS',
382 'HIDE_READ_SHOWS_SPECIAL');
383
384create table ttrss_user_prefs (
385 owner_uid integer not null,
386 pref_name varchar(250),
387 value longtext not null,
388 profile integer,
389 index (profile),
390 foreign key (profile) references ttrss_settings_profiles(id) ON DELETE CASCADE,
391 foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE,
392 foreign key (pref_name) references ttrss_prefs(pref_name) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
393
394create table ttrss_sessions (id varchar(250) not null primary key,
395 data text,
396 expire integer not null,
397 index (expire)) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
398
399create table ttrss_feedbrowser_cache (
400 feed_url text not null,
401 site_url text not null,
402 title text not null,
403 subscribers integer not null) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
404
405create table ttrss_labels2 (id integer not null primary key auto_increment,
406 owner_uid integer not null,
407 caption varchar(250) not null,
408 fg_color varchar(15) not null default '',
409 bg_color varchar(15) not null default '',
410 foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE
411) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
412
413create table ttrss_user_labels2 (label_id integer not null,
414 article_id integer not null,
415 foreign key (label_id) references ttrss_labels2(id) ON DELETE CASCADE,
416 foreign key (article_id) references ttrss_entries(id) ON DELETE CASCADE
417) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
418
419create table ttrss_access_keys (id integer not null primary key auto_increment,
420 access_key varchar(250) not null,
421 feed_id varchar(250) not null,
422 is_cat bool not null default false,
423 owner_uid integer not null,
424 foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
425
426create table ttrss_linked_instances (id integer not null primary key auto_increment,
427 last_connected datetime not null,
428 last_status_in integer not null,
429 last_status_out integer not null,
430 access_key varchar(250) not null unique,
431 access_url text not null) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
432
433create table ttrss_linked_feeds (
434 feed_url text not null,
435 site_url text not null,
436 title text not null,
437 created datetime not null,
438 updated datetime not null,
439 instance_id integer not null,
440 subscribers integer not null,
441 foreign key (instance_id) references ttrss_linked_instances(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
442
443create table ttrss_plugin_storage (
444 id integer not null auto_increment primary key,
445 name varchar(100) not null,
446 owner_uid integer not null,
447 content longtext not null,
448 foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
449
450create table ttrss_error_log(
451 id integer not null auto_increment primary key,
452 owner_uid integer,
453 errno integer not null,
454 errstr text not null,
455 filename text not null,
456 lineno integer not null,
457 context text not null,
458 created_at datetime not null,
459 foreign key (owner_uid) references ttrss_users(id) ON DELETE SET NULL) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
460
461commit;