unique(owner,feed)-- a given feed should only appear once for a given owner
);
-- entries in newsfeeds
createtablearsse_articles(
-- entries in newsfeeds
idintegerprimarykey,-- sequence number
feedintegernotnullreferencesarsse_feeds(id)ondeletecascade,-- feed for the subscription
urltext,-- URL of article
titletext,-- article title
authortext,-- author's name
publishedtext,-- time of original publication
editedtext,-- time of last edit
modifiedtextnotnulldefaultCURRENT_TIMESTAMP,-- date when article properties were last modified
editedtext,-- time of last edit by author
modifiedtextnotnulldefaultCURRENT_TIMESTAMP,-- time when article was last modified in database
contenttext,-- content, as (X)HTML
guidtext,-- GUID
url_title_hashtextnotnull,-- hash of URL + title; used when checking for updates and for identification if there is no guid.
@ -92,34 +108,37 @@ create table arsse_articles(
title_content_hashtextnotnull-- hash of title + content, enclosure URL, & content type; used when checking for updates and for identification if there is no guid.
articleintegernotnullreferencesarsse_articles(id)ondeletecascade,-- article associated with the marks
subscriptionintegernotnullreferencesarsse_subscriptions(id)ondeletecascadeonupdatecascade,-- subscription associated with the marks; the subscription in turn belongs to a user
readbooleannotnulldefault0,-- whether the article has been read
starredbooleannotnulldefault0,-- whether the article is starred
modifiedtextnotnulldefaultCURRENT_TIMESTAMP,-- time at which an article was last modified by a given user
primarykey(article,subscription)-- no more than one mark-set per article per user
);
-- IDs for specific editions of articles (required for at least NextCloud News)
labelintegernotnullreferencesarsse_labels(id)ondeletecascade,-- label ID associated to an article; label IDs belong to a user
articleintegernotnullreferencesarsse_articles(id)ondeletecascade,-- article associated to a label
subscriptionintegernotnullreferencesarsse_subscriptions(id)ondeletecascade,-- Subscription is included so that records are deleted when a subscription is removed
assignedbooleannotnulldefault1,
modifiedtextnotnulldefaultCURRENT_TIMESTAMP,
primarykey(label,article)
assignedbooleannotnulldefault1,-- whether the association is current, to support soft deletion
modifiedtextnotnulldefaultCURRENT_TIMESTAMP,-- time at which the association was last made or unmade
primarykey(label,article)-- only one association of a given label to a given article
)withoutrowid;
-- alter marks table to add Tiny Tiny RSS' notes
-- SQLite has limited ALTER TABLE support, so the table must be re-created
-- and its data re-entered; other database systems have a much simpler prodecure
articleintegernotnullreferencesarsse_articles(id)ondeletecascade,-- article associated with the marks
subscriptionintegernotnullreferencesarsse_subscriptions(id)ondeletecascadeonupdatecascade,-- subscription associated with the marks; the subscription in turn belongs to a user
readbooleannotnulldefault0,-- whether the article has been read
starredbooleannotnulldefault0,-- whether the article is starred
modifiedtextnotnulldefaultCURRENT_TIMESTAMP,-- time at which an article was last modified by a given user
notetextnotnulldefault'',-- Tiny Tiny RSS freeform user note
primarykey(article,subscription)-- no more than one mark-set per article per user
-- users' subscriptions to newsfeeds, with settings
idintegerprimarykey,-- sequence number
ownertextnotnullreferencesarsse_users(id)ondeletecascadeonupdatecascade,-- owner of subscription
feedintegernotnullreferencesarsse_feeds(id)ondeletecascade,-- feed for the subscription
addedtextnotnulldefaultCURRENT_TIMESTAMP,-- time at which feed was added
modifiedtextnotnulldefaultCURRENT_TIMESTAMP,-- time at which subscription properties were last modified
titletextcollatenocase,-- user-supplied title
order_typeintnotnulldefault0,-- NextCloud sort order
pinnedbooleannotnulldefault0,-- whether feed is pinned (always sorts at top)
folderintegerreferencesarsse_folders(id)ondeletecascade,-- TT-RSS category (nestable); the first-level category (which acts as NextCloud folder) is joined in when needed
unique(owner,feed)-- a given feed should only appear once for a given owner
feedintegernotnullreferencesarsse_feeds(id)ondeletecascade,-- feed for the subscription
urltext,-- URL of article
titletextcollatenocase,-- article title
authortextcollatenocase,-- author's name
publishedtext,-- time of original publication
editedtext,-- time of last edit by author
modifiedtextnotnulldefaultCURRENT_TIMESTAMP,-- time when article was last modified in database
contenttext,-- content, as (X)HTML
guidtext,-- GUID
url_title_hashtextnotnull,-- hash of URL + title; used when checking for updates and for identification if there is no guid.
url_content_hashtextnotnull,-- hash of URL + content, enclosure URL, & content type; used when checking for updates and for identification if there is no guid.
title_content_hashtextnotnull-- hash of title + content, enclosure URL, & content type; used when checking for updates and for identification if there is no guid.