require_once "functions.php";
define('EXPECTED_CONFIG_VERSION', 17);
- define('SCHEMA_VERSION', 43);
+ define('SCHEMA_VERSION', 44);
if (!file_exists("config.php")) {
print __("<b>Fatal Error</b>: You forgot to copy
drop table if exists ttrss_user_entries;
drop table if exists ttrss_entries;
drop table if exists ttrss_scheduled_updates;
+drop table if exists ttrss_counters_cache;
drop table if exists ttrss_feeds;
drop table if exists ttrss_feed_categories;
drop table if exists ttrss_users;
index(owner_uid),
foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) TYPE=InnoDB;
+create table ttrss_counters_cache (
+ feed_id integer not null,
+ owner_uid integer not null,
+ value integer not null default 0,
+ foreign key (feed_id) references ttrss_feeds(id) ON DELETE CASCADE,
+ foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE
+);
+
create table ttrss_feeds (id integer not null auto_increment primary key,
owner_uid integer not null,
title varchar(200) not null,
create table ttrss_version (schema_version int not null) TYPE=InnoDB;
-insert into ttrss_version values (43);
+insert into ttrss_version values (44);
create table ttrss_enclosures (id serial not null primary key,
content_url text not null,
drop table ttrss_user_entries;
drop table ttrss_entries;
drop table ttrss_scheduled_updates;
+drop table ttrss_counters_cache;
drop table ttrss_feeds;
drop table ttrss_feed_categories;
drop table ttrss_users;
insert into ttrss_feeds (owner_uid, title, feed_url) values
(1, 'Tiny Tiny RSS: Forum', 'http://tt-rss.spb.ru/forum/rss.php');
+create table ttrss_counters_cache (
+ feed_id integer not null references ttrss_feeds(id) ON DELETE CASCADE,
+ owner_uid integer not null references ttrss_users(id) ON DELETE CASCADE,
+ value integer not null default 0);
+
create table ttrss_entries (id serial not null primary key,
title text not null,
guid text not null unique,
create table ttrss_version (schema_version int not null);
-insert into ttrss_version values (43);
+insert into ttrss_version values (44);
create table ttrss_enclosures (id serial not null primary key,
content_url text not null,
--- /dev/null
+create table ttrss_counters_cache (
+ feed_id integer not null,
+ owner_uid integer not null,
+ value integer not null default 0,
+ foreign key (feed_id) references ttrss_feeds(id) ON DELETE CASCADE,
+ foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE
+);
+
+update ttrss_version set schema_version = 44;
--- /dev/null
+create table ttrss_counters_cache (
+ feed_id integer not null references ttrss_feeds(id) ON DELETE CASCADE,
+ owner_uid integer not null references ttrss_users(id) ON DELETE CASCADE,
+ value integer not null default 0);
+
+update ttrss_version set schema_version = 44;