]>
Commit | Line | Data |
---|---|---|
84004f8c AD |
1 | SET NAMES utf8; |
2 | SET CHARACTER SET utf8; | |
150b4a2c | 3 | |
889a5f9f | 4 | drop table if exists ttrss_error_log; |
5d9abb1e | 5 | drop table if exists ttrss_plugin_storage; |
58fa1bbc AD |
6 | drop table if exists ttrss_linked_feeds; |
7 | drop table if exists ttrss_linked_instances; | |
8801fb01 | 8 | drop table if exists ttrss_access_keys; |
f8bfb81f AD |
9 | drop table if exists ttrss_user_labels2; |
10 | drop table if exists ttrss_labels2; | |
0c630ef3 | 11 | drop table if exists ttrss_feedbrowser_cache; |
81dde650 AD |
12 | drop table if exists ttrss_version; |
13 | drop table if exists ttrss_labels; | |
6aff7845 AD |
14 | drop table if exists ttrss_filters2_actions; |
15 | drop table if exists ttrss_filters2_rules; | |
16 | drop table if exists ttrss_filters2; | |
5ddc7504 | 17 | drop table if exists ttrss_filters; |
81dde650 | 18 | drop table if exists ttrss_filter_types; |
53d6935b | 19 | drop table if exists ttrss_filter_actions; |
81dde650 AD |
20 | drop table if exists ttrss_user_prefs; |
21 | drop table if exists ttrss_prefs; | |
22 | drop table if exists ttrss_prefs_types; | |
58fa1bbc | 23 | drop table if exists ttrss_prefs_sections; |
eb36b4eb | 24 | drop table if exists ttrss_tags; |
963d3314 | 25 | drop table if exists ttrss_enclosures; |
d9084cf2 | 26 | drop table if exists ttrss_settings_profiles; |
8caa7999 | 27 | drop table if exists ttrss_entry_comments; |
81dde650 | 28 | drop table if exists ttrss_user_entries; |
648472a7 | 29 | drop table if exists ttrss_entries; |
ab5eb26f | 30 | drop table if exists ttrss_scheduled_updates; |
4d736378 | 31 | drop table if exists ttrss_counters_cache; |
8a4c759e | 32 | drop table if exists ttrss_cat_counters_cache; |
648472a7 | 33 | drop table if exists ttrss_feeds; |
24902606 | 34 | drop table if exists ttrss_archived_feeds; |
4a9a8bd8 | 35 | drop table if exists ttrss_feed_categories; |
a6ccf566 | 36 | drop table if exists ttrss_users; |
e552e5a2 | 37 | drop table if exists ttrss_themes; |
36bfab86 | 38 | drop table if exists ttrss_sessions; |
e552e5a2 | 39 | |
855d0ecf AD |
40 | begin; |
41 | ||
a6ccf566 AD |
42 | create 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, | |
f16ef236 | 45 | last_login datetime default null, |
e552e5a2 AD |
46 | access_level integer not null default 0, |
47 | theme_id integer default null, | |
8629e09d | 48 | email varchar(250) not null default '', |
73fe13af | 49 | full_name varchar(250) not null default '', |
32be4b10 AD |
50 | email_digest bool not null default false, |
51 | last_digest_sent datetime default null, | |
e90053fe | 52 | salt varchar(250) not null default '', |
54a3d3cf | 53 | created datetime default null, |
57e24c82 | 54 | twitter_oauth longtext default null, |
fb70f26e | 55 | otp_enabled boolean not null default false, |
3b19a53a | 56 | resetpass_token varchar(250) default null, |
7bfeaa17 | 57 | index (theme_id)) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
a6ccf566 | 58 | |
58fa1bbc | 59 | insert into ttrss_users (login,pwd_hash,access_level) values ('admin', |
7f16656e | 60 | 'SHA1:5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 10); |
648472a7 | 61 | |
17095c5a | 62 | create table ttrss_feed_categories(id integer not null primary key auto_increment, |
5a214f9d AD |
63 | owner_uid integer not null, |
64 | title varchar(200) not null, | |
28bcadff | 65 | collapsed bool not null default false, |
782ddd70 | 66 | order_id integer not null default 0, |
9432bfa0 | 67 | parent_cat integer, |
b4f83063 | 68 | view_settings varchar(250) not null default '', |
9432bfa0 AD |
69 | index(parent_cat), |
70 | foreign key (parent_cat) references ttrss_feed_categories(id) ON DELETE SET NULL, | |
5a214f9d | 71 | index(owner_uid), |
7bfeaa17 | 72 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
4a9a8bd8 | 73 | |
24902606 AD |
74 | create table ttrss_archived_feeds (id integer not null primary key, |
75 | owner_uid integer not null, | |
58fa1bbc AD |
76 | title varchar(200) not null, |
77 | feed_url text not null, | |
24902606 AD |
78 | site_url varchar(250) not null default '', |
79 | index(owner_uid), | |
7bfeaa17 | 80 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
24902606 | 81 | |
4d736378 AD |
82 | create table ttrss_counters_cache ( |
83 | feed_id integer not null, | |
84 | owner_uid integer not null, | |
85 | value integer not null default 0, | |
a1eba24b | 86 | updated datetime not null, |
8a4c759e | 87 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE |
4df07d50 | 88 | ) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
8a4c759e | 89 | |
ed7f0ecd AD |
90 | create index ttrss_counters_cache_feed_id_idx on ttrss_counters_cache(feed_id); |
91 | create index ttrss_counters_cache_owner_uid_idx on ttrss_counters_cache(owner_uid); | |
92 | create index ttrss_counters_cache_value_idx on ttrss_counters_cache(value); | |
93 | ||
8a4c759e AD |
94 | create table ttrss_cat_counters_cache ( |
95 | feed_id integer not null, | |
96 | owner_uid integer not null, | |
97 | value integer not null default 0, | |
98 | updated datetime not null, | |
4d736378 | 99 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE |
4df07d50 | 100 | ) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
4d736378 | 101 | |
ed7f0ecd AD |
102 | create index ttrss_cat_counters_cache_owner_uid_idx on ttrss_cat_counters_cache(owner_uid); |
103 | ||
648472a7 | 104 | create table ttrss_feeds (id integer not null auto_increment primary key, |
a6ccf566 | 105 | owner_uid integer not null, |
58fa1bbc | 106 | title varchar(200) not null, |
4a9a8bd8 | 107 | cat_id integer default null, |
58fa1bbc | 108 | feed_url text not null, |
648472a7 | 109 | icon_url varchar(250) not null default '', |
d148926e | 110 | update_interval integer not null default 0, |
1089b16b | 111 | purge_interval integer not null default 0, |
13b98333 | 112 | last_updated datetime default 0, |
0d276d67 | 113 | last_error varchar(250) not null default '', |
14118af3 | 114 | favicon_avg_color varchar(11) default null, |
a6ccf566 | 115 | site_url varchar(250) not null default '', |
e93a3c96 AD |
116 | auth_login varchar(250) not null default '', |
117 | auth_pass varchar(250) not null default '', | |
de99f500 | 118 | parent_feed integer default null, |
5b35b4de | 119 | private bool not null default false, |
70f6dbb1 | 120 | rtl_content bool not null default false, |
7da377ca | 121 | hidden bool not null default false, |
3dd9183c | 122 | include_in_digest boolean not null default true, |
fb67e2ba | 123 | cache_images boolean not null default false, |
bfd61d3f | 124 | hide_images boolean not null default false, |
87764a50 | 125 | cache_content boolean not null default false, |
155a2a53 | 126 | auth_pass_encrypted boolean not null default false, |
14fb4e91 | 127 | last_viewed datetime default null, |
3c50da83 | 128 | last_update_started datetime default null, |
e0382fd6 | 129 | always_display_enclosures boolean not null default false, |
5b8534ef | 130 | update_method integer not null default 0, |
56781036 | 131 | order_id integer not null default 0, |
9382ca84 | 132 | mark_unread_on_update boolean not null default false, |
74b046a1 | 133 | update_on_checksum_change boolean not null default false, |
9382ca84 | 134 | strip_images boolean not null default false, |
b4f83063 | 135 | view_settings varchar(250) not null default '', |
5ab9791f | 136 | pubsub_state integer not null default 0, |
382268c6 | 137 | favicon_last_checked datetime default null, |
a6ccf566 | 138 | index(owner_uid), |
4a9a8bd8 AD |
139 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE, |
140 | index(cat_id), | |
f0907182 | 141 | foreign key (cat_id) references ttrss_feed_categories(id) ON DELETE SET NULL, |
de99f500 | 142 | index(parent_feed), |
7bfeaa17 | 143 | foreign key (parent_feed) references ttrss_feeds(id) ON DELETE SET NULL) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
a6ccf566 | 144 | |
44f1eeed AD |
145 | create index ttrss_feeds_owner_uid_index on ttrss_feeds(owner_uid); |
146 | create index ttrss_feeds_cat_id_idx on ttrss_feeds(cat_id); | |
147 | ||
078b5702 | 148 | insert into ttrss_feeds (owner_uid, title, feed_url) values |
1f8c187d | 149 | (1, 'Tiny Tiny RSS: New Releases', 'http://tt-rss.org/releases.rss'); |
078b5702 | 150 | |
58fa1bbc | 151 | insert into ttrss_feeds (owner_uid, title, feed_url) values |
1f8c187d | 152 | (1, 'Tiny Tiny RSS: Forum', 'http://tt-rss.org/forum/rss.php'); |
648472a7 | 153 | |
58fa1bbc AD |
154 | create table ttrss_entries (id integer not null primary key auto_increment, |
155 | title text not null, | |
156 | guid varchar(255) not null unique, | |
157 | link text not null, | |
158 | updated datetime not null, | |
8e54a21e | 159 | content longtext not null, |
648472a7 | 160 | content_hash varchar(250) not null, |
87764a50 | 161 | cached_content longtext, |
8158c57a | 162 | no_orig_date bool not null default 0, |
c62d62f6 | 163 | date_entered datetime not null, |
25ea2805 | 164 | date_updated datetime not null, |
eb40e11b | 165 | num_comments integer not null default 0, |
7bfb3dab | 166 | plugin_data longtext, |
6b461797 | 167 | lang varchar(2), |
4bc760da | 168 | comments varchar(250) not null default '', |
7bfeaa17 | 169 | author varchar(250) not null default '') ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
c62d62f6 | 170 | |
b60e1d86 | 171 | create index ttrss_entries_date_entered_index on ttrss_entries(date_entered); |
ed7f0ecd AD |
172 | create index ttrss_entries_guid_index on ttrss_entries(guid); |
173 | create index ttrss_entries_updated_idx on ttrss_entries(updated); | |
b60e1d86 | 174 | |
c62d62f6 AD |
175 | create table ttrss_user_entries ( |
176 | int_id integer not null primary key auto_increment, | |
177 | ref_id integer not null, | |
83cd33fc | 178 | uuid varchar(200) not null, |
58fa1bbc AD |
179 | feed_id int, |
180 | orig_feed_id int, | |
c62d62f6 AD |
181 | owner_uid integer not null, |
182 | marked bool not null default 0, | |
ffba8297 | 183 | published bool not null default 0, |
490c366d | 184 | tag_cache text not null, |
905ff52a | 185 | label_cache text not null, |
c62d62f6 | 186 | last_read datetime, |
afb6038e | 187 | score int not null default 0, |
8e54a21e | 188 | note longtext, |
7873d588 AD |
189 | last_marked datetime, |
190 | last_published datetime, | |
1696229f | 191 | unread bool not null default 1, |
c62d62f6 AD |
192 | index (ref_id), |
193 | foreign key (ref_id) references ttrss_entries(id) ON DELETE CASCADE, | |
1696229f | 194 | index (feed_id), |
a6ccf566 | 195 | foreign key (feed_id) references ttrss_feeds(id) ON DELETE CASCADE, |
e04c18a2 | 196 | index (orig_feed_id), |
24902606 | 197 | foreign key (orig_feed_id) references ttrss_archived_feeds(id) ON DELETE SET NULL, |
a6ccf566 | 198 | index (owner_uid), |
7bfeaa17 | 199 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
648472a7 | 200 | |
8514e925 AD |
201 | create index ttrss_user_entries_owner_uid_index on ttrss_user_entries(owner_uid); |
202 | create index ttrss_user_entries_ref_id_index on ttrss_user_entries(ref_id); | |
203 | create index ttrss_user_entries_feed_id on ttrss_user_entries(feed_id); | |
ed7f0ecd AD |
204 | create index ttrss_user_entries_unread_idx on ttrss_user_entries(unread); |
205 | ||
8caa7999 AD |
206 | create table ttrss_entry_comments (id integer not null primary key, |
207 | ref_id integer not null, | |
208 | owner_uid integer not null, | |
209 | private bool not null default 0, | |
210 | date_entered datetime not null, | |
211 | index (ref_id), | |
212 | foreign key (ref_id) references ttrss_entries(id) ON DELETE CASCADE, | |
213 | index (owner_uid), | |
7bfeaa17 | 214 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
8caa7999 | 215 | |
58fa1bbc AD |
216 | create table ttrss_filter_types (id integer primary key, |
217 | name varchar(120) unique not null, | |
7bfeaa17 | 218 | description varchar(250) not null unique) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
648472a7 | 219 | |
648472a7 AD |
220 | insert into ttrss_filter_types (id,name,description) values (1, 'title', 'Title'); |
221 | insert into ttrss_filter_types (id,name,description) values (2, 'content', 'Content'); | |
58fa1bbc | 222 | insert into ttrss_filter_types (id,name,description) values (3, 'both', |
648472a7 | 223 | 'Title or Content'); |
58fa1bbc | 224 | insert into ttrss_filter_types (id,name,description) values (4, 'link', |
3a933f22 | 225 | 'Link'); |
58fa1bbc | 226 | insert into ttrss_filter_types (id,name,description) values (5, 'date', |
75fa1e31 | 227 | 'Article Date'); |
fa3317be | 228 | insert into ttrss_filter_types (id,name,description) values (6, 'author', 'Author'); |
c3fc5e47 | 229 | insert into ttrss_filter_types (id,name,description) values (7, 'tag', 'Article Tags'); |
648472a7 | 230 | |
58fa1bbc AD |
231 | create table ttrss_filter_actions (id integer not null primary key, |
232 | name varchar(120) unique not null, | |
7bfeaa17 | 233 | description varchar(250) not null unique) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
53d6935b | 234 | |
58fa1bbc | 235 | insert into ttrss_filter_actions (id,name,description) values (1, 'filter', |
b9ad7cfa | 236 | 'Delete article'); |
53d6935b | 237 | |
58fa1bbc | 238 | insert into ttrss_filter_actions (id,name,description) values (2, 'catchup', |
53d6935b AD |
239 | 'Mark as read'); |
240 | ||
58fa1bbc | 241 | insert into ttrss_filter_actions (id,name,description) values (3, 'mark', |
dd7d3187 AD |
242 | 'Set starred'); |
243 | ||
58fa1bbc | 244 | insert into ttrss_filter_actions (id,name,description) values (4, 'tag', |
de07b5ee | 245 | 'Assign tags'); |
7cb9311b | 246 | |
58fa1bbc | 247 | insert into ttrss_filter_actions (id,name,description) values (5, 'publish', |
0c4811be AD |
248 | 'Publish article'); |
249 | ||
58fa1bbc | 250 | insert into ttrss_filter_actions (id,name,description) values (6, 'score', |
fdb7b03f AD |
251 | 'Modify score'); |
252 | ||
58fa1bbc | 253 | insert into ttrss_filter_actions (id,name,description) values (7, 'label', |
ceb30ba4 AD |
254 | 'Assign label'); |
255 | ||
5e736e45 AD |
256 | insert into ttrss_filter_actions (id,name,description) values (8, 'stop', |
257 | 'Stop / Do nothing'); | |
258 | ||
6aff7845 AD |
259 | create table ttrss_filters2(id integer primary key auto_increment, |
260 | owner_uid integer not null, | |
261 | match_any_rule boolean not null default false, | |
262 | enabled boolean not null default true, | |
a3a896a1 | 263 | inverse bool not null default false, |
8e8c8934 AD |
264 | title varchar(250) not null default '', |
265 | order_id integer not null default 0, | |
6aff7845 AD |
266 | index(owner_uid), |
267 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
fb70f26e | 268 | |
6aff7845 AD |
269 | create table ttrss_filters2_rules(id integer primary key auto_increment, |
270 | filter_id integer not null references ttrss_filters2(id) on delete cascade, | |
271 | reg_exp varchar(250) not null, | |
a3a896a1 | 272 | inverse bool not null default false, |
6aff7845 AD |
273 | filter_type integer not null, |
274 | feed_id integer default null, | |
275 | cat_id integer default null, | |
276 | cat_filter boolean not null default false, | |
277 | index (filter_id), | |
278 | foreign key (filter_id) references ttrss_filters2(id) on delete cascade, | |
279 | index (filter_type), | |
280 | foreign key (filter_type) references ttrss_filter_types(id) ON DELETE CASCADE, | |
281 | index (feed_id), | |
282 | foreign key (feed_id) references ttrss_feeds(id) ON DELETE CASCADE, | |
283 | index (cat_id), | |
284 | foreign key (cat_id) references ttrss_feed_categories(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
285 | ||
286 | create table ttrss_filters2_actions(id integer primary key auto_increment, | |
287 | filter_id integer not null, | |
288 | action_id integer not null default 1 references ttrss_filter_actions(id) on delete cascade, | |
289 | action_param varchar(250) not null default '', | |
290 | index (filter_id), | |
291 | foreign key (filter_id) references ttrss_filters2(id) on delete cascade, | |
292 | index (action_id), | |
293 | foreign key (action_id) references ttrss_filter_actions(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
294 | ||
58fa1bbc AD |
295 | create table ttrss_tags (id integer primary key auto_increment, |
296 | owner_uid integer not null, | |
eb36b4eb | 297 | tag_name varchar(250) not null, |
c62d62f6 AD |
298 | post_int_id integer not null, |
299 | index (post_int_id), | |
300 | foreign key (post_int_id) references ttrss_user_entries(int_id) ON DELETE CASCADE, | |
a6ccf566 | 301 | index (owner_uid), |
7bfeaa17 | 302 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
eb36b4eb | 303 | |
7bfeaa17 | 304 | create table ttrss_version (schema_version int not null) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
5f171894 | 305 | |
3b19a53a | 306 | insert into ttrss_version values (124); |
5f171894 | 307 | |
d9084cf2 | 308 | create table ttrss_enclosures (id integer primary key auto_increment, |
963d3314 AD |
309 | content_url text not null, |
310 | content_type varchar(250) not null, | |
311 | post_id integer not null, | |
aa6d1e97 | 312 | title text not null, |
ce53e200 | 313 | duration text not null, |
963d3314 | 314 | index (post_id), |
7bfeaa17 | 315 | foreign key (post_id) references ttrss_entries(id) ON DELETE cascade) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
963d3314 | 316 | |
f0143d4e AD |
317 | create index ttrss_enclosures_post_id_idx on ttrss_enclosures(post_id); |
318 | ||
d9084cf2 AD |
319 | create table ttrss_settings_profiles(id integer primary key auto_increment, |
320 | title varchar(250) not null, | |
321 | owner_uid integer not null, | |
322 | index (owner_uid), | |
7bfeaa17 | 323 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
d9084cf2 | 324 | |
58fa1bbc | 325 | create table ttrss_prefs_types (id integer not null primary key, |
7bfeaa17 | 326 | type_name varchar(100) not null) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
e0257be1 AD |
327 | |
328 | insert into ttrss_prefs_types (id, type_name) values (1, 'bool'); | |
329 | insert into ttrss_prefs_types (id, type_name) values (2, 'string'); | |
330 | insert into ttrss_prefs_types (id, type_name) values (3, 'integer'); | |
331 | ||
58fa1bbc | 332 | create table ttrss_prefs_sections (id integer not null primary key, |
923b5c8b | 333 | order_id integer not null) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
e0257be1 | 334 | |
923b5c8b AD |
335 | insert into ttrss_prefs_sections (id, order_id) values (1, 0); |
336 | insert into ttrss_prefs_sections (id, order_id) values (2, 1); | |
337 | insert into ttrss_prefs_sections (id, order_id) values (3, 3); | |
338 | insert into ttrss_prefs_sections (id, order_id) values (4, 2); | |
e0257be1 | 339 | |
a6ccf566 | 340 | create table ttrss_prefs (pref_name varchar(250) not null primary key, |
e0257be1 AD |
341 | type_id integer not null, |
342 | section_id integer not null default 1, | |
2b6ed06b | 343 | access_level integer not null default 0, |
e0257be1 | 344 | def_value text not null, |
e0257be1 AD |
345 | index(type_id), |
346 | foreign key (type_id) references ttrss_prefs_types(id), | |
347 | index(section_id), | |
7bfeaa17 | 348 | foreign key (section_id) references ttrss_prefs_sections(id)) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
e0257be1 | 349 | |
2ced2bb8 AD |
350 | create index ttrss_prefs_pref_name_idx on ttrss_prefs(pref_name); |
351 | ||
923b5c8b AD |
352 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('PURGE_OLD_DAYS', 3, '60', 1); |
353 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('DEFAULT_UPDATE_INTERVAL', 3, '30', 1); | |
354 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('DEFAULT_ARTICLE_LIMIT', 3, '30', 2); | |
881a1580 | 355 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('ALLOW_DUPLICATE_POSTS', 1, 'false', 1); |
923b5c8b AD |
356 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('ENABLE_FEED_CATS', 1, 'true', 2); |
357 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('SHOW_CONTENT_PREVIEW', 1, 'true', 2); | |
358 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('SHORT_DATE_FORMAT', 2, 'M d, G:i', 3); | |
359 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('LONG_DATE_FORMAT', 2, 'D, M d Y - G:i', 3); | |
360 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('COMBINED_DISPLAY_MODE', 1, 'true', 2); | |
361 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('HIDE_READ_FEEDS', 1, 'false', 2); | |
362 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('ON_CATCHUP_SHOW_NEXT_FEED', 1, 'false', 2); | |
363 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('FEEDS_SORT_BY_UNREAD', 1, 'false', 2); | |
364 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('REVERSE_HEADLINES', 1, 'false', 2); | |
365 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('DIGEST_ENABLE', 1, 'false', 4); | |
366 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('CONFIRM_FEED_CATCHUP', 1, 'true', 2); | |
367 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('CDM_AUTO_CATCHUP', 1, 'false', 2); | |
368 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_DEFAULT_VIEW_MODE', 2, 'adaptive', 1); | |
369 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_DEFAULT_VIEW_LIMIT', 3, '30', 1); | |
370 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_PREFS_ACTIVE_TAB', 2, '', 1); | |
371 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('STRIP_UNSAFE_TAGS', 1, 'true', 3); | |
372 | 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); | |
373 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('FRESH_ARTICLE_MAX_AGE', 3, '24', 2); | |
374 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('DIGEST_CATCHUP', 1, 'false', 4); | |
375 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('CDM_EXPANDED', 1, 'true', 2); | |
376 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('PURGE_UNREAD_ARTICLES', 1, 'true', 3); | |
377 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('HIDE_READ_SHOWS_SPECIAL', 1, 'true', 2); | |
378 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('VFEED_GROUP_BY_FEED', 1, 'false', 2); | |
379 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('STRIP_IMAGES', 1, 'false', 2); | |
380 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_DEFAULT_VIEW_ORDER_BY', 2, 'default', 1); | |
381 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('ENABLE_API_ACCESS', 1, 'false', 1); | |
382 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_COLLAPSED_SPECIAL', 1, 'false', 1); | |
383 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_COLLAPSED_LABELS', 1, 'false', 1); | |
384 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_COLLAPSED_UNCAT', 1, 'false', 1); | |
385 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_COLLAPSED_FEEDLIST', 1, 'false', 1); | |
386 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_MOBILE_ENABLE_CATS', 1, 'false', 1); | |
387 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_MOBILE_SHOW_IMAGES', 1, 'false', 1); | |
388 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_MOBILE_HIDE_READ', 1, 'false', 1); | |
389 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_MOBILE_SORT_FEEDS_UNREAD', 1, 'false', 1); | |
390 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_THEME_ID', 2, '0', 1); | |
3fbb4d18 | 391 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('USER_TIMEZONE', 2, 'Automatic', 1); |
923b5c8b AD |
392 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('USER_STYLESHEET', 2, '', 2); |
393 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('SORT_HEADLINES_BY_FEED_DATE', 1, 'false', 2); | |
394 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_MOBILE_BROWSE_CATS', 1, 'true', 1); | |
395 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('SSL_CERT_SERIAL', 2, '', 3); | |
396 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('DIGEST_PREFERRED_TIME', 2, '00:00', 4); | |
397 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_PREFS_SHOW_EMPTY_CATS', 1, 'false', 1); | |
398 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_DEFAULT_INCLUDE_CHILDREN', 1, 'false', 1); | |
2457679a | 399 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('AUTO_ASSIGN_LABELS', 1, 'false', 3); |
923b5c8b AD |
400 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_ENABLED_PLUGINS', 2, '', 1); |
401 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_MOBILE_REVERSE_HEADLINES', 1, 'false', 1); | |
402 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('USER_CSS_THEME', 2, '', 2); | |
7b149552 | 403 | insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('USER_LANGUAGE', 2, '', 2); |
5d40efc9 | 404 | |
f9ebb32c AD |
405 | update ttrss_prefs set access_level = 1 where pref_name in ('ON_CATCHUP_SHOW_NEXT_FEED', |
406 | 'SORT_HEADLINES_BY_FEED_DATE', | |
407 | 'VFEED_GROUP_BY_FEED', | |
408 | 'FRESH_ARTICLE_MAX_AGE', | |
409 | 'CDM_EXPANDED', | |
410 | 'SHOW_CONTENT_PREVIEW', | |
b24504b1 | 411 | 'AUTO_ASSIGN_LABELS', |
f9ebb32c AD |
412 | 'HIDE_READ_SHOWS_SPECIAL'); |
413 | ||
a6ccf566 AD |
414 | create table ttrss_user_prefs ( |
415 | owner_uid integer not null, | |
416 | pref_name varchar(250), | |
88e4e597 | 417 | value longtext not null, |
d9084cf2 AD |
418 | profile integer, |
419 | index (profile), | |
420 | foreign key (profile) references ttrss_settings_profiles(id) ON DELETE CASCADE, | |
a6ccf566 AD |
421 | index (owner_uid), |
422 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE, | |
423 | index (pref_name), | |
7bfeaa17 | 424 | foreign key (pref_name) references ttrss_prefs(pref_name) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
a6ccf566 | 425 | |
2ced2bb8 AD |
426 | create index ttrss_user_prefs_owner_uid_index on ttrss_user_prefs(owner_uid); |
427 | create index ttrss_user_prefs_pref_name_idx on ttrss_user_prefs(pref_name); | |
428 | ||
04febb04 | 429 | create table ttrss_sessions (id varchar(250) unique not null primary key, |
36bfab86 AD |
430 | data text, |
431 | expire integer not null, | |
58fa1bbc | 432 | index (id), |
7bfeaa17 | 433 | index (expire)) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
36bfab86 | 434 | |
0c630ef3 AD |
435 | create table ttrss_feedbrowser_cache ( |
436 | feed_url text not null, | |
109662e1 | 437 | site_url text not null, |
931dcbc1 | 438 | title text not null, |
4df07d50 | 439 | subscribers integer not null) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
0c630ef3 | 440 | |
58fa1bbc | 441 | create table ttrss_labels2 (id integer not null primary key auto_increment, |
ceb30ba4 AD |
442 | owner_uid integer not null, |
443 | caption varchar(250) not null, | |
aec57d7a AD |
444 | fg_color varchar(15) not null default '', |
445 | bg_color varchar(15) not null default '', | |
ceb30ba4 | 446 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE |
7bfeaa17 | 447 | ) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
ceb30ba4 AD |
448 | |
449 | create table ttrss_user_labels2 (label_id integer not null, | |
450 | article_id integer not null, | |
451 | foreign key (label_id) references ttrss_labels2(id) ON DELETE CASCADE, | |
452 | foreign key (article_id) references ttrss_entries(id) ON DELETE CASCADE | |
7bfeaa17 | 453 | ) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
ceb30ba4 | 454 | |
58fa1bbc | 455 | create table ttrss_access_keys (id integer not null primary key auto_increment, |
8801fb01 AD |
456 | access_key varchar(250) not null, |
457 | feed_id varchar(250) not null, | |
458 | is_cat bool not null default false, | |
459 | owner_uid integer not null, | |
7bfeaa17 | 460 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
8801fb01 | 461 | |
58fa1bbc | 462 | create table ttrss_linked_instances (id integer not null primary key auto_increment, |
afb875cc | 463 | last_connected datetime not null, |
cfc06471 AD |
464 | last_status_in integer not null, |
465 | last_status_out integer not null, | |
1eb3012f | 466 | access_key varchar(250) not null unique, |
7bfeaa17 | 467 | access_url text not null) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
58fa1bbc AD |
468 | |
469 | create table ttrss_linked_feeds ( | |
470 | feed_url text not null, | |
109662e1 | 471 | site_url text not null, |
58fa1bbc AD |
472 | title text not null, |
473 | created datetime not null, | |
474 | updated datetime not null, | |
475 | instance_id integer not null, | |
476 | subscribers integer not null, | |
7bfeaa17 | 477 | foreign key (instance_id) references ttrss_linked_instances(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; |
58fa1bbc | 478 | |
5d9abb1e AD |
479 | create table ttrss_plugin_storage ( |
480 | id integer not null auto_increment primary key, | |
481 | name varchar(100) not null, | |
482 | owner_uid integer not null, | |
483 | content longtext not null, | |
484 | foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
485 | ||
889a5f9f AD |
486 | create table ttrss_error_log( |
487 | id integer not null auto_increment primary key, | |
488 | owner_uid integer, | |
489 | errno integer not null, | |
490 | errstr text not null, | |
491 | filename text not null, | |
3fbb4d18 | 492 | lineno integer not null, |
889a5f9f AD |
493 | context text not null, |
494 | created_at datetime not null, | |
495 | foreign key (owner_uid) references ttrss_users(id) ON DELETE SET NULL) ENGINE=InnoDB DEFAULT CHARSET=UTF8; | |
5d9abb1e | 496 | |
855d0ecf | 497 | commit; |