J. King
5 years ago
16 changed files with 90 additions and 19 deletions
@ -0,0 +1,23 @@ |
|||||
|
-- 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; |
||||
|
|
||||
|
update arsse_meta set value = '5' where "key" = 'schema_version'; |
@ -0,0 +1,23 @@ |
|||||
|
-- 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 bigserial primary key, |
||||
|
owner text not null references arsse_users(id) on delete cascade on update cascade, |
||||
|
name text not null collate "und-x-icu", |
||||
|
modified timestamp(0) without time zone not null default CURRENT_TIMESTAMP, |
||||
|
unique(owner,name) |
||||
|
); |
||||
|
|
||||
|
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 smallint not null default 1, |
||||
|
modified timestamp(0) without time zone not null default CURRENT_TIMESTAMP, |
||||
|
primary key(tag,subscription) |
||||
|
); |
||||
|
|
||||
|
update arsse_meta set value = '5' where "key" = 'schema_version'; |
@ -0,0 +1,25 @@ |
|||||
|
-- SPDX-License-Identifier: MIT |
||||
|
-- Copyright 2017 J. King, Dustin Wilson et al. |
||||
|
-- See LICENSE and AUTHORS files for details |
||||
|
|
||||
|
create table arsse_tags( |
||||
|
-- user-defined subscription tags |
||||
|
id integer primary key, -- numeric ID |
||||
|
owner text not null references arsse_users(id) on delete cascade on update cascade, -- owning user |
||||
|
name text not null collate nocase, -- tag text |
||||
|
modified text not null default CURRENT_TIMESTAMP, -- time at which the tag was last modified |
||||
|
unique(owner,name) |
||||
|
); |
||||
|
|
||||
|
create table arsse_tag_members( |
||||
|
-- tag assignments for subscriptions |
||||
|
tag integer not null references arsse_tags(id) on delete cascade, -- tag ID associated to a subscription |
||||
|
subscription integer not null references arsse_subscriptions(id) on delete cascade, -- Subscription associated to a tag |
||||
|
assigned boolean not null default 1, -- whether the association is current, to support soft deletion |
||||
|
modified text not null default CURRENT_TIMESTAMP, -- time at which the association was last made or unmade |
||||
|
primary key(tag,subscription) -- only one association of a given tag to a given subscription |
||||
|
) without rowid; |
||||
|
|
||||
|
-- set version marker |
||||
|
pragma user_version = 5; |
||||
|
update arsse_meta set value = '5' where "key" = 'schema_version'; |
Loading…
Reference in new issue