mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 13:12:41 +00:00
Hopefully complete MySQL schema
This commit is contained in:
parent
86c16d3cb3
commit
316ba941a2
4 changed files with 47 additions and 14 deletions
|
@ -7,7 +7,7 @@
|
|||
create table arsse_meta(
|
||||
`key` varchar(255) primary key,
|
||||
value longtext
|
||||
);
|
||||
) character set utf8mb4;
|
||||
|
||||
create table arsse_users(
|
||||
id varchar(255) primary key,
|
||||
|
@ -17,14 +17,14 @@ create table arsse_users(
|
|||
avatar_data longblob,
|
||||
admin boolean default 0,
|
||||
rights bigint not null default 0
|
||||
);
|
||||
) character set utf8mb4;
|
||||
|
||||
create table arsse_users_meta(
|
||||
owner varchar(255) not null references arsse_users(id) on delete cascade on update cascade,
|
||||
`key` varchar(255) not null,
|
||||
value varchar(255),
|
||||
primary key(owner,`key`)
|
||||
);
|
||||
) character set utf8mb4;
|
||||
|
||||
create table arsse_folders(
|
||||
id serial primary key,
|
||||
|
@ -33,7 +33,7 @@ create table arsse_folders(
|
|||
name varchar(255) not null,
|
||||
modified datetime(0) not null default CURRENT_TIMESTAMP, --
|
||||
unique(owner,name,parent)
|
||||
);
|
||||
) character set utf8mb4;
|
||||
|
||||
create table arsse_feeds(
|
||||
id serial primary key,
|
||||
|
@ -53,7 +53,7 @@ create table arsse_feeds(
|
|||
size bigint not null default 0,
|
||||
scrape boolean not null default 0,
|
||||
unique(url,username,password)
|
||||
);
|
||||
) character set utf8mb4;
|
||||
|
||||
create table arsse_subscriptions(
|
||||
id serial primary key,
|
||||
|
@ -66,7 +66,7 @@ create table arsse_subscriptions(
|
|||
pinned boolean not null default 0,
|
||||
folder bigint references arsse_folders(id) on delete cascade,
|
||||
unique(owner,feed)
|
||||
);
|
||||
) character set utf8mb4;
|
||||
|
||||
create table arsse_articles(
|
||||
id serial primary key,
|
||||
|
@ -82,13 +82,13 @@ create table arsse_articles(
|
|||
url_title_hash varchar(255) not null,
|
||||
url_content_hash varchar(255) not null,
|
||||
title_content_hash varchar(255) not null
|
||||
);
|
||||
) character set utf8mb4;
|
||||
|
||||
create table arsse_enclosures(
|
||||
article bigint not null references arsse_articles(id) on delete cascade,
|
||||
url varchar(255),
|
||||
type varchar(255)
|
||||
);
|
||||
) character set utf8mb4;
|
||||
|
||||
create table arsse_marks(
|
||||
article bigint not null references arsse_articles(id) on delete cascade,
|
||||
|
@ -97,17 +97,17 @@ create table arsse_marks(
|
|||
starred boolean not null default 0,
|
||||
modified datetime(0) not null default CURRENT_TIMESTAMP,
|
||||
primary key(article,subscription)
|
||||
);
|
||||
) character set utf8mb4;
|
||||
|
||||
create table arsse_editions(
|
||||
id serial primary key,
|
||||
article bigint not null references arsse_articles(id) on delete cascade,
|
||||
modified datetime(0) not null default CURRENT_TIMESTAMP
|
||||
);
|
||||
) character set utf8mb4;
|
||||
|
||||
create table arsse_categories(
|
||||
article bigint not null references arsse_articles(id) on delete cascade,
|
||||
name varchar(255)
|
||||
);
|
||||
) character set utf8mb4;
|
||||
|
||||
insert into arsse_meta(`key`,value) values('schema_version','1');
|
||||
|
|
|
@ -9,7 +9,7 @@ create table arsse_sessions (
|
|||
created datetime(0) not null default CURRENT_TIMESTAMP,
|
||||
expires datetime(0) not null,
|
||||
`user` varchar(255) not null references arsse_users(id) on delete cascade on update cascade
|
||||
);
|
||||
) character set utf8mb4;
|
||||
|
||||
create table arsse_labels (
|
||||
id serial primary key,
|
||||
|
@ -17,7 +17,7 @@ create table arsse_labels (
|
|||
name varchar(255) not null,
|
||||
modified datetime(0) not null default CURRENT_TIMESTAMP,
|
||||
unique(owner,name)
|
||||
);
|
||||
) character set utf8mb4;
|
||||
|
||||
create table arsse_label_members (
|
||||
label bigint not null references arsse_labels(id) on delete cascade,
|
||||
|
@ -26,7 +26,7 @@ create table arsse_label_members (
|
|||
assigned boolean not null default 1,
|
||||
modified datetime(0) not null default CURRENT_TIMESTAMP,
|
||||
primary key(label,article)
|
||||
);
|
||||
) character set utf8mb4;
|
||||
|
||||
alter table arsse_marks add column note longtext not null default '';
|
||||
|
||||
|
|
23
sql/MySQL/2.sql
Normal file
23
sql/MySQL/2.sql
Normal file
|
@ -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
|
||||
|
||||
alter table arsse_users default character set utf8mb4 collate utf8mb4_unicode_nopad_ci;
|
||||
alter table arsse_folders default character set utf8mb4 collate utf8mb4_unicode_nopad_ci;
|
||||
alter table arsse_feeds default character set utf8mb4 collate utf8mb4_unicode_nopad_ci;
|
||||
alter table arsse_subscriptions default character set utf8mb4 collate utf8mb4_unicode_nopad_ci;
|
||||
alter table arsse_articles default character set utf8mb4 collate utf8mb4_unicode_nopad_ci;
|
||||
alter table arsse_categories default character set utf8mb4 collate utf8mb4_unicode_nopad_ci;
|
||||
alter table arsse_labels default character set utf8mb4 collate utf8mb4_unicode_nopad_ci;
|
||||
|
||||
alter table arsse_users convert to character set utf8mb4 collate utf8mb4_unicode_nopad_ci;
|
||||
alter table arsse_folders convert to character set utf8mb4 collate utf8mb4_unicode_nopad_ci;
|
||||
alter table arsse_feeds convert to character set utf8mb4 collate utf8mb4_unicode_nopad_ci;
|
||||
alter table arsse_subscriptions convert to character set utf8mb4 collate utf8mb4_unicode_nopad_ci;
|
||||
alter table arsse_articles convert to character set utf8mb4 collate utf8mb4_unicode_nopad_ci;
|
||||
alter table arsse_categories convert to character set utf8mb4 collate utf8mb4_unicode_nopad_ci;
|
||||
alter table arsse_labels convert to character set utf8mb4 collate utf8mb4_unicode_nopad_ci;
|
||||
|
||||
update arsse_meta set value = '3' where `key` = 'schema_version';
|
10
sql/MySQL/3.sql
Normal file
10
sql/MySQL/3.sql
Normal file
|
@ -0,0 +1,10 @@
|
|||
-- 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_marks change column modified modified datetime(0);
|
||||
alter table arsse_marks add column touched boolean not null default 0;
|
||||
|
||||
update arsse_meta set value = '4' where `key` = 'schema_version';
|
Loading…
Reference in a new issue