mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-01 13:34:33 +00:00
feat(ui): add collection and share link pages and management actions
This commit is contained in:
+11
@@ -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;
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user