mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 21:22:40 +00:00
Add modification timestamps for ownCloud API
This commit is contained in:
parent
b4ad50e492
commit
c3bc913240
1 changed files with 20 additions and 14 deletions
14
schema.sql
14
schema.sql
|
@ -17,6 +17,7 @@ create table chibi_categories(
|
||||||
parent integer, -- parent category id
|
parent integer, -- parent category id
|
||||||
folder integer not null, -- first-level category (ownCloud folder)
|
folder integer not null, -- first-level category (ownCloud folder)
|
||||||
name TEXT not null, -- category name
|
name TEXT not null, -- category name
|
||||||
|
modified datetime not null default CURRENT_TIMESTAMP, --
|
||||||
unique(owner,name,parent) -- cannot have multiple categories with the same name under the same parent for the same owner
|
unique(owner,name,parent) -- cannot have multiple categories with the same name under the same parent for the same owner
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -28,11 +29,12 @@ create table chibi_feeds(
|
||||||
favicon TEXT, -- URL of favicon
|
favicon TEXT, -- URL of favicon
|
||||||
source TEXT, -- URL of site to which the feed belongs
|
source TEXT, -- URL of site to which the feed belongs
|
||||||
updated datetime, -- time at which the feed was last fetched
|
updated datetime, -- time at which the feed was last fetched
|
||||||
|
modified datetime not null default CURRENT_TIMESTAMP, --
|
||||||
err_count integer not null default 0, -- count of successive times update resulted in error since last successful update
|
err_count integer not null default 0, -- count of successive times update resulted in error since last successful update
|
||||||
err_msg TEXT, -- last error message
|
err_msg TEXT, -- last error message
|
||||||
username TEXT, -- HTTP authentication username
|
username TEXT, -- HTTP authentication username
|
||||||
password TEXT, -- HTTP authentication password (this is stored in plain text)
|
password TEXT, -- HTTP authentication password (this is stored in plain text)
|
||||||
unique(url,username,password) --
|
unique(url,username,password) -- a URL with particular credentials should only appear once
|
||||||
);
|
);
|
||||||
|
|
||||||
-- users' subscriptions to newsfeeds, with settings
|
-- users' subscriptions to newsfeeds, with settings
|
||||||
|
@ -41,10 +43,12 @@ create table chibi_subscriptions(
|
||||||
owner TEXT references users(id) on delete cascade on update cascade, -- owner of subscription
|
owner TEXT references users(id) on delete cascade on update cascade, -- owner of subscription
|
||||||
feed integer references feeds(id) on delete cascade, -- feed for the subscription
|
feed integer references feeds(id) on delete cascade, -- feed for the subscription
|
||||||
added datetime not null default CURRENT_TIMESTAMP, -- time at which feed was added
|
added datetime not null default CURRENT_TIMESTAMP, -- time at which feed was added
|
||||||
|
modified datetime not null default CURRENT_TIMESTAMP, -- date at which subscription properties were last modified
|
||||||
title TEXT, -- user-supplied title
|
title TEXT, -- user-supplied title
|
||||||
order_type int not null default 0, -- ownCloud sort order
|
order_type int not null default 0, -- ownCloud sort order
|
||||||
pinned boolean not null default 0, -- whether feed is pinned (always sorts at top)
|
pinned boolean not null default 0, -- whether feed is pinned (always sorts at top)
|
||||||
category integer references categories(id) on delete set null -- TT-RSS category (nestable); the first-level category (which acts as ownCloud folder) is joined in when needed
|
category integer references categories(id) on delete set null, -- TT-RSS category (nestable); the first-level category (which acts as ownCloud folder) is joined in when needed
|
||||||
|
unique(owner,feed) -- a given feed should only appear once for a given owner
|
||||||
);
|
);
|
||||||
|
|
||||||
-- entries in newsfeeds
|
-- entries in newsfeeds
|
||||||
|
@ -58,6 +62,7 @@ create table chibi_articles(
|
||||||
edited datetime, -- time of last edit
|
edited datetime, -- time of last edit
|
||||||
guid TEXT, -- GUID
|
guid TEXT, -- GUID
|
||||||
content TEXT, -- content, as (X)HTML
|
content TEXT, -- content, as (X)HTML
|
||||||
|
modified datetime not null default CURRENT_TIMESTAMP, -- date when article properties were last modified
|
||||||
hash varchar(64) not null, -- ownCloud hash
|
hash varchar(64) not null, -- ownCloud hash
|
||||||
fingerprint varchar(64) not null, -- ownCloud fingerprint
|
fingerprint varchar(64) not null, -- ownCloud fingerprint
|
||||||
enclosures_hash varchar(64), -- hash of enclosures, if any; since enclosures are not uniquely identified, we need to know when they change
|
enclosures_hash varchar(64), -- hash of enclosures, if any; since enclosures are not uniquely identified, we need to know when they change
|
||||||
|
@ -66,10 +71,11 @@ create table chibi_articles(
|
||||||
|
|
||||||
-- users' actions on newsfeed entries
|
-- users' actions on newsfeed entries
|
||||||
create table chibi_subscription_articles(
|
create table chibi_subscription_articles(
|
||||||
id integer primary key,
|
id integer primary key not null,
|
||||||
article integer references articles(id) on delete cascade,
|
article integer references articles(id) on delete cascade,
|
||||||
read boolean not null default 0,
|
read boolean not null default 0,
|
||||||
starred boolean not null default 0
|
starred boolean not null default 0,
|
||||||
|
modified datetime not null default CURRENT_TIMESTAMP
|
||||||
);
|
);
|
||||||
|
|
||||||
-- enclosures associated with articles
|
-- enclosures associated with articles
|
||||||
|
|
Loading…
Reference in a new issue