feat: 实现文件夹和书签的持久排序与拖拽功能
This commit is contained in:
@@ -15,6 +15,7 @@ create table if not exists bookmark_folders (
|
||||
parent_id uuid null references bookmark_folders(id) on delete cascade,
|
||||
name text not null,
|
||||
visibility text not null default 'private',
|
||||
sort_order integer not null default 0,
|
||||
created_at timestamptz not null default now(),
|
||||
updated_at timestamptz not null default now()
|
||||
);
|
||||
@@ -25,6 +26,7 @@ create table if not exists bookmarks (
|
||||
id uuid primary key default gen_random_uuid(),
|
||||
user_id uuid not null references users(id) on delete cascade,
|
||||
folder_id uuid null references bookmark_folders(id) on delete set null,
|
||||
sort_order integer not null default 0,
|
||||
title text not null,
|
||||
url text not null,
|
||||
url_normalized text not null,
|
||||
@@ -37,5 +39,6 @@ create table if not exists bookmarks (
|
||||
);
|
||||
|
||||
create index if not exists idx_bookmarks_user_updated_at on bookmarks (user_id, updated_at);
|
||||
create index if not exists idx_bookmarks_user_folder_sort on bookmarks (user_id, folder_id, sort_order);
|
||||
create index if not exists idx_bookmarks_user_url_hash on bookmarks (user_id, url_hash);
|
||||
create index if not exists idx_bookmarks_visibility on bookmarks (visibility);
|
||||
|
||||
Reference in New Issue
Block a user