2020-10-29 15:58:45 +00:00
|
|
|
-- SPDX-License-Identifier: MIT
|
|
|
|
-- Copyright 2017 J. King, Dustin Wilson et al.
|
|
|
|
-- See LICENSE and AUTHORS files for details
|
|
|
|
|
2020-11-04 23:34:22 +00:00
|
|
|
-- Please consult the SQLite 3 schemata for commented version
|
|
|
|
|
2020-11-06 16:06:27 +00:00
|
|
|
alter table arsse_tokens add column data text default null;
|
|
|
|
|
2020-12-15 01:09:38 +00:00
|
|
|
alter table arsse_subscriptions add column keep_rule text default null;
|
|
|
|
alter table arsse_subscriptions add column block_rule text default null;
|
2020-12-15 18:20:03 +00:00
|
|
|
alter table arsse_marks add column hidden smallint not null default 0;
|
2020-12-15 01:09:38 +00:00
|
|
|
|
2020-10-30 23:00:11 +00:00
|
|
|
alter table arsse_users add column num bigint unique;
|
|
|
|
alter table arsse_users add column admin smallint not null default 0;
|
|
|
|
create temp table arsse_users_existing(
|
|
|
|
id text not null,
|
|
|
|
num bigserial
|
|
|
|
);
|
|
|
|
insert into arsse_users_existing(id) select id from arsse_users;
|
|
|
|
update arsse_users as u
|
|
|
|
set num = e.num
|
|
|
|
from arsse_users_existing as e
|
|
|
|
where u.id = e.id;
|
|
|
|
drop table arsse_users_existing;
|
|
|
|
alter table arsse_users alter column num set not null;
|
2020-10-29 15:58:45 +00:00
|
|
|
|
2020-12-05 16:01:44 +00:00
|
|
|
create table arsse_user_meta(
|
|
|
|
owner text not null references arsse_users(id) on delete cascade on update cascade,
|
|
|
|
key text not null,
|
2020-12-08 21:10:23 +00:00
|
|
|
modified timestamp(0) without time zone not null default CURRENT_TIMESTAMP,
|
2020-12-05 16:01:44 +00:00
|
|
|
value text,
|
|
|
|
primary key(owner,key)
|
|
|
|
);
|
|
|
|
|
2021-01-16 19:24:01 +00:00
|
|
|
alter table arsse_subscriptions add column scrape smallint not null default 0;
|
2021-01-17 00:06:20 +00:00
|
|
|
update arsse_subscriptions set scrape = 1 where feed in (select id from arsse_feeds where scrape = 1);
|
2021-01-16 19:24:01 +00:00
|
|
|
alter table arsse_feeds drop column scrape;
|
|
|
|
alter table arsse_articles add column content_scraped text;
|
|
|
|
|
2020-11-04 23:34:22 +00:00
|
|
|
create table arsse_icons(
|
|
|
|
id bigserial primary key,
|
|
|
|
url text unique not null,
|
|
|
|
modified timestamp(0) without time zone,
|
|
|
|
etag text not null default '',
|
|
|
|
next_fetch timestamp(0) without time zone,
|
|
|
|
orphaned timestamp(0) without time zone,
|
|
|
|
type text,
|
|
|
|
data bytea
|
|
|
|
);
|
2020-11-06 15:28:28 +00:00
|
|
|
insert into arsse_icons(url) select distinct favicon from arsse_feeds where favicon is not null and favicon <> '';
|
2020-11-04 23:34:22 +00:00
|
|
|
alter table arsse_feeds add column icon bigint references arsse_icons(id) on delete set null;
|
|
|
|
update arsse_feeds as f set icon = i.id from arsse_icons as i where f.favicon = i.url;
|
|
|
|
alter table arsse_feeds drop column favicon;
|
|
|
|
|
2020-10-29 15:58:45 +00:00
|
|
|
update arsse_meta set value = '7' where "key" = 'schema_version';
|