mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 21:22:40 +00:00
8fc31cfc40
This involved changes to the driver interface as well as the database schemata. The most significantly altered queries were for article selection and marking, which relied upon unusual features of SQLite. Overall query efficiency should not be adversely affected (it may have even imprved) in the common case, while very rare cases (not presently triggered by any REST handlers) require more queries. One notable benefit of these changes is that functions which query articles can now have complete control over which columns are returned. This has not, however, been implemented yet: symbolic column groups are still used for now. Note that PostgreSQL still fails many tests, but the test suite runs to completion. Note also that one line of the Database class is not covered; later changes will eventually make it easier to cover the line in question.
24 lines
1.9 KiB
SQL
24 lines
1.9 KiB
SQL
-- SPDX-License-Identifier: MIT
|
|
-- Copyright 2017 J. King, Dustin Wilson et al.
|
|
-- See LICENSE and AUTHORS files for details
|
|
|
|
-- 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
|
|
alter table arsse_marks rename to arsse_marks_old;
|
|
create table arsse_marks(
|
|
-- users' actions on newsfeed entries
|
|
article integer not null references arsse_articles(id) on delete cascade, -- article associated with the marks
|
|
subscription integer not null references arsse_subscriptions(id) on delete cascade on update cascade, -- subscription associated with the marks; the subscription in turn belongs to a user
|
|
read boolean not null default 0, -- whether the article has been read
|
|
starred boolean not null default 0, -- whether the article is starred
|
|
modified text, -- time at which an article was last modified by a given user
|
|
note text not null default '', -- Tiny Tiny RSS freeform user note
|
|
touched boolean not null default 0, -- used to indicate a record has been modified during the course of some transactions
|
|
primary key(article,subscription) -- no more than one mark-set per article per user
|
|
);
|
|
insert into arsse_marks select article,subscription,read,starred,modified,note,0 from arsse_marks_old;
|
|
drop table arsse_marks_old;
|
|
|
|
-- set version marker
|
|
pragma user_version = 4;
|
|
update arsse_meta set value = '4' where key = 'schema_version';
|