summaryrefslogtreecommitdiff
path: root/schema
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2008-10-13 14:10:31 +0100
committerAndrew Dolgov <[email protected]>2008-10-13 14:10:31 +0100
commit4d73637869e2e9d3adf4e7d9dc327a41bd071eb9 (patch)
tree88c4f324ce08e491e1834e37da35bde0890ed596 /schema
parent20be0cf8e73948645c451831d2bfbf27ecc59e10 (diff)
schema: add ttrss_counters_cache
Diffstat (limited to 'schema')
-rw-r--r--schema/ttrss_schema_mysql.sql11
-rw-r--r--schema/ttrss_schema_pgsql.sql8
-rw-r--r--schema/versions/mysql/44.sql9
-rw-r--r--schema/versions/pgsql/44.sql6
4 files changed, 32 insertions, 2 deletions
diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql
index 9b3ce6975..889ca6a03 100644
--- a/schema/ttrss_schema_mysql.sql
+++ b/schema/ttrss_schema_mysql.sql
@@ -16,6 +16,7 @@ drop table if exists ttrss_entry_comments;
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;
@@ -57,6 +58,14 @@ create table ttrss_feed_categories(id integer not null primary key auto_incremen
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,
@@ -210,7 +219,7 @@ create table ttrss_tags (id integer primary key auto_increment,
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,
diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql
index dd419891e..9d716f235 100644
--- a/schema/ttrss_schema_pgsql.sql
+++ b/schema/ttrss_schema_pgsql.sql
@@ -13,6 +13,7 @@ drop table ttrss_entry_comments;
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;
@@ -83,6 +84,11 @@ insert into ttrss_feeds (owner_uid, title, feed_url) values
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,
@@ -190,7 +196,7 @@ create index ttrss_tags_owner_uid_index on ttrss_tags(owner_uid);
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,
diff --git a/schema/versions/mysql/44.sql b/schema/versions/mysql/44.sql
new file mode 100644
index 000000000..c17bcc38f
--- /dev/null
+++ b/schema/versions/mysql/44.sql
@@ -0,0 +1,9 @@
+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;
diff --git a/schema/versions/pgsql/44.sql b/schema/versions/pgsql/44.sql
new file mode 100644
index 000000000..a88bfede6
--- /dev/null
+++ b/schema/versions/pgsql/44.sql
@@ -0,0 +1,6 @@
+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;