1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-23 17:12:41 +00:00
Arsse/sql/MySQL/6.sql

52 lines
2.1 KiB
MySQL
Raw Normal View History

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
-- Please consult the SQLite 3 schemata for commented version
alter table arsse_tokens add column data longtext default null;
2020-12-15 01:09:38 +00:00
alter table arsse_subscriptions add column keep_rule longtext default null;
alter table arsse_subscriptions add column block_rule longtext default null;
alter table arsse_marks add column hidden boolean 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 unsigned unique;
alter table arsse_users add column admin boolean not null default 0;
create temporary table arsse_users_existing(
id text not null,
num serial primary key
) character set utf8mb4 collate utf8mb4_unicode_ci;
insert into arsse_users_existing(id) select id from arsse_users;
update arsse_users as u, arsse_users_existing as n
set u.num = n.num
where u.id = n.id;
drop table arsse_users_existing;
alter table arsse_users modify num bigint unsigned not null;
2020-10-29 15:58:45 +00:00
2020-12-05 16:01:44 +00:00
create table arsse_user_meta(
owner varchar(255) not null,
"key" varchar(255) not null,
modified datetime(0) not null default CURRENT_TIMESTAMP,
2020-12-05 16:01:44 +00:00
value longtext,
foreign key(owner) references arsse_users(id) on delete cascade on update cascade,
2020-12-06 18:17:19 +00:00
primary key(owner,"key")
) character set utf8mb4 collate utf8mb4_unicode_ci;
2020-12-05 16:01:44 +00:00
create table arsse_icons(
id serial primary key,
url varchar(767) unique not null,
modified datetime(0),
etag varchar(255) not null default '',
next_fetch datetime(0),
orphaned datetime(0),
type text,
data longblob
) character set utf8mb4 collate utf8mb4_unicode_ci;
insert into arsse_icons(url) select distinct favicon from arsse_feeds where favicon is not null and favicon <> '';
alter table arsse_feeds add column icon bigint unsigned;
alter table arsse_feeds add constraint foreign key (icon) references arsse_icons(id) on delete set null;
update arsse_feeds as f, arsse_icons as i set f.icon = i.id 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';