-- 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
altertablearsse_marksrenametoarsse_marks_old;
createtablearsse_marks(
createtablearsse_marks_new(
-- users' actions on newsfeed entries
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
@ -43,8 +42,9 @@ create table arsse_marks(
notetextnotnulldefault'',-- Tiny Tiny RSS freeform user note
primarykey(article,subscription)-- no more than one mark-set per article per user
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
@ -93,22 +92,22 @@ create table arsse_articles(
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.
-- allow marks to initially have a null date due to changes in how marks are first created
-- and also add a "touched" column to aid in tracking changes during the course of some transactions
altertablearsse_marksrenametoarsse_marks_old;
createtablearsse_marks(
createtablearsse_marks_new(
-- users' actions on newsfeed entries
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
@ -16,8 +15,9 @@ create table arsse_marks(
touchedbooleannotnulldefault0,-- used to indicate a record has been modified during the course of some transactions
primarykey(article,subscription)-- no more than one mark-set per article per user