unique(owner,feed)-- a given feed should only appear once for a given owner
unique(owner,feed)-- a given feed should only appear once for a given owner
);
);
-- entries in newsfeeds
createtablearsse_articles(
createtablearsse_articles(
-- entries in newsfeeds
idintegerprimarykey,-- sequence number
idintegerprimarykey,-- sequence number
feedintegernotnullreferencesarsse_feeds(id)ondeletecascade,-- feed for the subscription
feedintegernotnullreferencesarsse_feeds(id)ondeletecascade,-- feed for the subscription
urltext,-- URL of article
urltext,-- URL of article
titletext,-- article title
titletext,-- article title
authortext,-- author's name
authortext,-- author's name
publishedtext,-- time of original publication
publishedtext,-- time of original publication
editedtext,-- time of last edit
editedtext,-- time of last edit by author
modifiedtextnotnulldefaultCURRENT_TIMESTAMP,-- date when article properties were last modified
modifiedtextnotnulldefaultCURRENT_TIMESTAMP,-- time when article was last modified in database
contenttext,-- content, as (X)HTML
contenttext,-- content, as (X)HTML
guidtext,-- GUID
guidtext,-- GUID
url_title_hashtextnotnull,-- hash of URL + title; used when checking for updates and for identification if there is no 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.
title_content_hashtextnotnull-- hash of title + content, enclosure URL, & content type; used when checking for updates and for identification if there is no guid.
subscriptionintegernotnullreferencesarsse_subscriptions(id)ondeletecascadeonupdatecascade,-- subscription associated with the marks; the subscription in turn belongs to a user
readbooleannotnulldefault0,
readbooleannotnulldefault0,-- whether the article has been read
starredbooleannotnulldefault0,
starredbooleannotnulldefault0,-- whether the article is starred
modifiedtextnotnulldefaultCURRENT_TIMESTAMP,
modifiedtextnotnulldefaultCURRENT_TIMESTAMP,-- time at which an article was last modified by a given user
primarykey(article,subscription)
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)
createtablearsse_editions(
createtablearsse_editions(
idintegerprimarykey,
-- 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
subscriptionintegernotnullreferencesarsse_subscriptions(id)ondeletecascade,-- Subscription is included so that records are deleted when a subscription is removed
assignedbooleannotnulldefault1,
assignedbooleannotnulldefault1,-- whether the association is current, to support soft deletion
modifiedtextnotnulldefaultCURRENT_TIMESTAMP,
modifiedtextnotnulldefaultCURRENT_TIMESTAMP,-- time at which the association was last made or unmade
primarykey(label,article)
primarykey(label,article)-- only one association of a given label to a given article
)withoutrowid;
)withoutrowid;
-- alter marks table to add Tiny Tiny RSS' notes
-- 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
readbooleannotnulldefault0,
subscriptionintegernotnullreferencesarsse_subscriptions(id)ondeletecascadeonupdatecascade,-- subscription associated with the marks; the subscription in turn belongs to a user
starredbooleannotnulldefault0,
readbooleannotnulldefault0,-- whether the article has been read
modifiedtextnotnulldefaultCURRENT_TIMESTAMP,
starredbooleannotnulldefault0,-- whether the article is starred
notetextnotnulldefault'',
modifiedtextnotnulldefaultCURRENT_TIMESTAMP,-- time at which an article was last modified by a given user
primarykey(article,subscription)
notetextnotnulldefault'',-- Tiny Tiny RSS freeform user note
primarykey(article,subscription)-- no more than one mark-set per article per user
pinnedbooleannotnulldefault0,-- whether feed is pinned (always sorts at top)
unique(owner,feed)
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
titletextcollatenocase,
urltext,-- URL of article
authortextcollatenocase,
titletextcollatenocase,-- article title
publishedtext,
authortextcollatenocase,-- author's name
editedtext,
publishedtext,-- time of original publication
modifiedtextnotnulldefaultCURRENT_TIMESTAMP,
editedtext,-- time of last edit by author
contenttext,
modifiedtextnotnulldefaultCURRENT_TIMESTAMP,-- time when article was last modified in database
guidtext,
contenttext,-- content, as (X)HTML
url_title_hashtextnotnull,
guidtext,-- GUID
url_content_hashtextnotnull,
url_title_hashtextnotnull,-- hash of URL + title; used when checking for updates and for identification if there is no guid.
title_content_hashtextnotnull
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.