1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-22 21:22:40 +00:00
Arsse/sql/MySQL/4.sql
J. King 38bdde1167 Add access tokens to the db, with relevant code
Tokens are similar to sessions in that they stand in for users, but the
protocol handlers will manage them; Fever login hashes are the
originating use case for them. These must never expire, for example,
and we need to specify their values.

This commit also performs a bit of database clean-up
2019-03-09 16:23:56 -05:00

41 lines
1.5 KiB
SQL

-- 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
create table arsse_tags(
id serial primary key,
owner varchar(255) not null references arsse_users(id) on delete cascade on update cascade,
name varchar(255) not null,
modified datetime(0) not null default CURRENT_TIMESTAMP,
unique(owner,name)
) character set utf8mb4 collate utf8mb4_unicode_ci;
create table arsse_tag_members(
tag bigint not null references arsse_tags(id) on delete cascade,
subscription bigint not null references arsse_subscriptions(id) on delete cascade,
assigned boolean not null default 1,
modified datetime(0) not null default CURRENT_TIMESTAMP,
primary key(tag,subscription)
) character set utf8mb4 collate utf8mb4_unicode_ci;
create table arsse_tokens(
id varchar(255) not null,
class varchar(255) not null,
"user" varchar(255) not null references arsse_users(id) on delete cascade on update cascade,
created datetime(0) not null default CURRENT_TIMESTAMP,
expires datetime(0),
primary key(id,class)
) character set utf8mb4 collate utf8mb4_unicode_ci;
alter table arsse_users drop column name;
alter table arsse_users drop column avatar_type;
alter table arsse_users drop column avatar_data;
alter table arsse_users drop column admin;
alter table arsse_users drop column rights;
drop table arsse_users_meta;
update arsse_meta set value = '5' where "key" = 'schema_version';