feat(ui): add collection and share link pages and management actions

This commit is contained in:
yiling
2026-06-06 12:02:51 +08:00
parent 0d76ddfc34
commit 6ebeb3f804
22 changed files with 2052 additions and 69 deletions
@@ -0,0 +1,11 @@
-- AlterTable
ALTER TABLE "collections" ADD COLUMN "creator_id" TEXT;
-- AlterTable
ALTER TABLE "share_links" ADD COLUMN "creator_id" TEXT;
-- AddForeignKey
ALTER TABLE "share_links" ADD CONSTRAINT "share_links_creator_id_fkey" FOREIGN KEY ("creator_id") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "collections" ADD CONSTRAINT "collections_creator_id_fkey" FOREIGN KEY ("creator_id") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+8
View File
@@ -145,6 +145,8 @@ model User {
agent Agent?
agentSessions AgentSession[]
userMetadata UserMetadata[] @relation("UserToUserMetadata")
collections Collection[] @relation("UserToCollection")
shareLinks ShareLink[] @relation("UserToShareLink")
@@map("users")
}
@@ -346,6 +348,9 @@ model ShareLink {
rootFolderId String @unique @map("root_folder_id")
rootFolder Asset @relation("ShareLinkToRootFolder", fields: [rootFolderId], references: [id])
creatorId String? @map("creator_id")
creator User? @relation("UserToShareLink", fields: [creatorId], references: [id])
@@map("share_links")
}
@@ -765,6 +770,9 @@ model Collection {
projectId String @map("project_id")
project Project @relation("ProjectToCollection", fields: [projectId], references: [id], onDelete: Cascade)
creatorId String? @map("creator_id")
creator User? @relation("UserToCollection", fields: [creatorId], references: [id])
@@index([projectId, createdAt(sort: Desc)])
@@map("collections")
}