Update ktorm, clean repositories and drop mariadb support
This commit is contained in:
+2
-3
@@ -9,7 +9,7 @@ create table Users
|
||||
|
||||
create table Notes
|
||||
(
|
||||
uuid binary(16) not null primary key,
|
||||
uuid uuid not null primary key,
|
||||
title varchar(50) not null,
|
||||
markdown mediumtext not null,
|
||||
html mediumtext not null,
|
||||
@@ -17,7 +17,6 @@ create table Notes
|
||||
updated_at datetime null,
|
||||
|
||||
constraint Notes_fk_user foreign key (user_id) references Users (id) on delete cascade
|
||||
|
||||
);
|
||||
|
||||
create index user_id on Notes (user_id);
|
||||
@@ -26,7 +25,7 @@ create table Tags
|
||||
(
|
||||
id int auto_increment primary key,
|
||||
name varchar(50) not null,
|
||||
note_uuid binary(16) not null,
|
||||
note_uuid uuid not null,
|
||||
constraint Tags_fk_note foreign key (note_uuid) references Notes (uuid) on delete cascade
|
||||
);
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
CREATE VIEW NotesWithTags AS
|
||||
SELECT n.*, coalesce(ARRAY_AGG(t.NAME), ARRAY[]) as tags
|
||||
FROM Notes n
|
||||
LEFT JOIN Tags t ON n.uuid = t.note_uuid
|
||||
GROUP BY n.uuid
|
||||
@@ -1,36 +0,0 @@
|
||||
create table Users
|
||||
(
|
||||
id int auto_increment primary key,
|
||||
username varchar(50) not null,
|
||||
password varchar(255) not null,
|
||||
|
||||
constraint username unique (username)
|
||||
) character set 'utf8mb4'
|
||||
collate 'utf8mb4_general_ci';
|
||||
|
||||
create table Notes
|
||||
(
|
||||
uuid binary(16) not null primary key,
|
||||
title varchar(50) not null,
|
||||
markdown mediumtext not null,
|
||||
html mediumtext not null,
|
||||
user_id int not null,
|
||||
updated_at datetime null,
|
||||
|
||||
constraint Notes_fk_user foreign key (user_id) references Users (id) on delete cascade
|
||||
|
||||
) character set 'utf8mb4'
|
||||
collate 'utf8mb4_general_ci';
|
||||
|
||||
create index user_id on Notes (user_id);
|
||||
|
||||
create table Tags
|
||||
(
|
||||
id int auto_increment primary key,
|
||||
name varchar(50) not null,
|
||||
note_uuid binary(16) not null,
|
||||
constraint Tags_fk_note foreign key (note_uuid) references Notes (uuid) on delete cascade
|
||||
) character set 'utf8mb4'
|
||||
collate 'utf8mb4_general_ci';
|
||||
|
||||
create index note_uuid on Tags (note_uuid);
|
||||
@@ -1,2 +0,0 @@
|
||||
alter table Notes
|
||||
add column deleted bool not null default false
|
||||
@@ -1,2 +0,0 @@
|
||||
alter table Notes
|
||||
add column public bool not null default false
|
||||
Reference in New Issue
Block a user