feat(db): preserve agent sessions on asset deletion by setting onDelete to SetNull

This commit is contained in:
yiling
2026-07-29 15:42:45 +08:00
parent f3d42cd0ce
commit cdc344ab7a
4 changed files with 73 additions and 2 deletions
+1 -1
View File
@@ -708,7 +708,7 @@ model AgentSession {
cwd String
leafId String? @map("leaf_id")
assetId String? @map("asset_id")
asset Asset? @relation("AssetToAgentSession", fields: [assetId], references: [id], onDelete: Cascade)
asset Asset? @relation("AssetToAgentSession", fields: [assetId], references: [id], onDelete: SetNull)
userCommentId String? @map("user_comment_id")
type AgentSessionType @default(comment)
name String?