fix(comment): remove unique constraint on session_id to allow multiple agent replies

This commit is contained in:
yiling
2026-05-22 11:05:40 +08:00
parent 71f2ebdd1a
commit 206e1ae7b1
6 changed files with 221 additions and 120 deletions
@@ -0,0 +1,2 @@
-- DropIndex
DROP INDEX "asset_comments_session_id_key";
+2 -2
View File
@@ -430,7 +430,7 @@ model AssetComment {
/// [AnnotationList]
annotation Json?
second Float?
sessionId String? @unique @map("session_id")
sessionId String? @map("session_id")
session AgentSession? @relation(fields: [sessionId], references: [id], onDelete: SetNull)
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
@@ -658,7 +658,7 @@ model AgentSession {
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
entries AgentSessionEntry[]
comment AssetComment?
comments AssetComment[]
@@map("agent_sessions")
}
File diff suppressed because one or more lines are too long
+58 -44
View File
@@ -203,7 +203,7 @@ export type AgentSessionWhereInput = {
agent?: Prisma.XOR<Prisma.AgentScalarRelationFilter, Prisma.AgentWhereInput>
user?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
entries?: Prisma.AgentSessionEntryListRelationFilter
comment?: Prisma.XOR<Prisma.AssetCommentNullableScalarRelationFilter, Prisma.AssetCommentWhereInput> | null
comments?: Prisma.AssetCommentListRelationFilter
}
export type AgentSessionOrderByWithRelationInput = {
@@ -217,7 +217,7 @@ export type AgentSessionOrderByWithRelationInput = {
agent?: Prisma.AgentOrderByWithRelationInput
user?: Prisma.UserOrderByWithRelationInput
entries?: Prisma.AgentSessionEntryOrderByRelationAggregateInput
comment?: Prisma.AssetCommentOrderByWithRelationInput
comments?: Prisma.AssetCommentOrderByRelationAggregateInput
}
export type AgentSessionWhereUniqueInput = Prisma.AtLeast<{
@@ -234,7 +234,7 @@ export type AgentSessionWhereUniqueInput = Prisma.AtLeast<{
agent?: Prisma.XOR<Prisma.AgentScalarRelationFilter, Prisma.AgentWhereInput>
user?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
entries?: Prisma.AgentSessionEntryListRelationFilter
comment?: Prisma.XOR<Prisma.AssetCommentNullableScalarRelationFilter, Prisma.AssetCommentWhereInput> | null
comments?: Prisma.AssetCommentListRelationFilter
}, "id">
export type AgentSessionOrderByWithAggregationInput = {
@@ -272,7 +272,7 @@ export type AgentSessionCreateInput = {
agent: Prisma.AgentCreateNestedOneWithoutAgentSessionsInput
user?: Prisma.UserCreateNestedOneWithoutAgentSessionsInput
entries?: Prisma.AgentSessionEntryCreateNestedManyWithoutSessionInput
comment?: Prisma.AssetCommentCreateNestedOneWithoutSessionInput
comments?: Prisma.AssetCommentCreateNestedManyWithoutSessionInput
}
export type AgentSessionUncheckedCreateInput = {
@@ -284,7 +284,7 @@ export type AgentSessionUncheckedCreateInput = {
createdAt?: Date | string
updatedAt?: Date | string
entries?: Prisma.AgentSessionEntryUncheckedCreateNestedManyWithoutSessionInput
comment?: Prisma.AssetCommentUncheckedCreateNestedOneWithoutSessionInput
comments?: Prisma.AssetCommentUncheckedCreateNestedManyWithoutSessionInput
}
export type AgentSessionUpdateInput = {
@@ -296,7 +296,7 @@ export type AgentSessionUpdateInput = {
agent?: Prisma.AgentUpdateOneRequiredWithoutAgentSessionsNestedInput
user?: Prisma.UserUpdateOneWithoutAgentSessionsNestedInput
entries?: Prisma.AgentSessionEntryUpdateManyWithoutSessionNestedInput
comment?: Prisma.AssetCommentUpdateOneWithoutSessionNestedInput
comments?: Prisma.AssetCommentUpdateManyWithoutSessionNestedInput
}
export type AgentSessionUncheckedUpdateInput = {
@@ -308,7 +308,7 @@ export type AgentSessionUncheckedUpdateInput = {
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
entries?: Prisma.AgentSessionEntryUncheckedUpdateManyWithoutSessionNestedInput
comment?: Prisma.AssetCommentUncheckedUpdateOneWithoutSessionNestedInput
comments?: Prisma.AssetCommentUncheckedUpdateManyWithoutSessionNestedInput
}
export type AgentSessionCreateManyInput = {
@@ -431,20 +431,20 @@ export type AgentSessionUncheckedUpdateManyWithoutUserNestedInput = {
deleteMany?: Prisma.AgentSessionScalarWhereInput | Prisma.AgentSessionScalarWhereInput[]
}
export type AgentSessionCreateNestedOneWithoutCommentInput = {
create?: Prisma.XOR<Prisma.AgentSessionCreateWithoutCommentInput, Prisma.AgentSessionUncheckedCreateWithoutCommentInput>
connectOrCreate?: Prisma.AgentSessionCreateOrConnectWithoutCommentInput
export type AgentSessionCreateNestedOneWithoutCommentsInput = {
create?: Prisma.XOR<Prisma.AgentSessionCreateWithoutCommentsInput, Prisma.AgentSessionUncheckedCreateWithoutCommentsInput>
connectOrCreate?: Prisma.AgentSessionCreateOrConnectWithoutCommentsInput
connect?: Prisma.AgentSessionWhereUniqueInput
}
export type AgentSessionUpdateOneWithoutCommentNestedInput = {
create?: Prisma.XOR<Prisma.AgentSessionCreateWithoutCommentInput, Prisma.AgentSessionUncheckedCreateWithoutCommentInput>
connectOrCreate?: Prisma.AgentSessionCreateOrConnectWithoutCommentInput
upsert?: Prisma.AgentSessionUpsertWithoutCommentInput
export type AgentSessionUpdateOneWithoutCommentsNestedInput = {
create?: Prisma.XOR<Prisma.AgentSessionCreateWithoutCommentsInput, Prisma.AgentSessionUncheckedCreateWithoutCommentsInput>
connectOrCreate?: Prisma.AgentSessionCreateOrConnectWithoutCommentsInput
upsert?: Prisma.AgentSessionUpsertWithoutCommentsInput
disconnect?: Prisma.AgentSessionWhereInput | boolean
delete?: Prisma.AgentSessionWhereInput | boolean
connect?: Prisma.AgentSessionWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.AgentSessionUpdateToOneWithWhereWithoutCommentInput, Prisma.AgentSessionUpdateWithoutCommentInput>, Prisma.AgentSessionUncheckedUpdateWithoutCommentInput>
update?: Prisma.XOR<Prisma.XOR<Prisma.AgentSessionUpdateToOneWithWhereWithoutCommentsInput, Prisma.AgentSessionUpdateWithoutCommentsInput>, Prisma.AgentSessionUncheckedUpdateWithoutCommentsInput>
}
export type AgentSessionCreateNestedManyWithoutAgentInput = {
@@ -511,7 +511,7 @@ export type AgentSessionCreateWithoutUserInput = {
updatedAt?: Date | string
agent: Prisma.AgentCreateNestedOneWithoutAgentSessionsInput
entries?: Prisma.AgentSessionEntryCreateNestedManyWithoutSessionInput
comment?: Prisma.AssetCommentCreateNestedOneWithoutSessionInput
comments?: Prisma.AssetCommentCreateNestedManyWithoutSessionInput
}
export type AgentSessionUncheckedCreateWithoutUserInput = {
@@ -522,7 +522,7 @@ export type AgentSessionUncheckedCreateWithoutUserInput = {
createdAt?: Date | string
updatedAt?: Date | string
entries?: Prisma.AgentSessionEntryUncheckedCreateNestedManyWithoutSessionInput
comment?: Prisma.AssetCommentUncheckedCreateNestedOneWithoutSessionInput
comments?: Prisma.AssetCommentUncheckedCreateNestedManyWithoutSessionInput
}
export type AgentSessionCreateOrConnectWithoutUserInput = {
@@ -564,7 +564,7 @@ export type AgentSessionScalarWhereInput = {
updatedAt?: Prisma.DateTimeFilter<"AgentSession"> | Date | string
}
export type AgentSessionCreateWithoutCommentInput = {
export type AgentSessionCreateWithoutCommentsInput = {
id?: string
cwd: string
leafId?: string | null
@@ -575,7 +575,7 @@ export type AgentSessionCreateWithoutCommentInput = {
entries?: Prisma.AgentSessionEntryCreateNestedManyWithoutSessionInput
}
export type AgentSessionUncheckedCreateWithoutCommentInput = {
export type AgentSessionUncheckedCreateWithoutCommentsInput = {
id?: string
agentId: string
userId?: string | null
@@ -586,23 +586,23 @@ export type AgentSessionUncheckedCreateWithoutCommentInput = {
entries?: Prisma.AgentSessionEntryUncheckedCreateNestedManyWithoutSessionInput
}
export type AgentSessionCreateOrConnectWithoutCommentInput = {
export type AgentSessionCreateOrConnectWithoutCommentsInput = {
where: Prisma.AgentSessionWhereUniqueInput
create: Prisma.XOR<Prisma.AgentSessionCreateWithoutCommentInput, Prisma.AgentSessionUncheckedCreateWithoutCommentInput>
create: Prisma.XOR<Prisma.AgentSessionCreateWithoutCommentsInput, Prisma.AgentSessionUncheckedCreateWithoutCommentsInput>
}
export type AgentSessionUpsertWithoutCommentInput = {
update: Prisma.XOR<Prisma.AgentSessionUpdateWithoutCommentInput, Prisma.AgentSessionUncheckedUpdateWithoutCommentInput>
create: Prisma.XOR<Prisma.AgentSessionCreateWithoutCommentInput, Prisma.AgentSessionUncheckedCreateWithoutCommentInput>
export type AgentSessionUpsertWithoutCommentsInput = {
update: Prisma.XOR<Prisma.AgentSessionUpdateWithoutCommentsInput, Prisma.AgentSessionUncheckedUpdateWithoutCommentsInput>
create: Prisma.XOR<Prisma.AgentSessionCreateWithoutCommentsInput, Prisma.AgentSessionUncheckedCreateWithoutCommentsInput>
where?: Prisma.AgentSessionWhereInput
}
export type AgentSessionUpdateToOneWithWhereWithoutCommentInput = {
export type AgentSessionUpdateToOneWithWhereWithoutCommentsInput = {
where?: Prisma.AgentSessionWhereInput
data: Prisma.XOR<Prisma.AgentSessionUpdateWithoutCommentInput, Prisma.AgentSessionUncheckedUpdateWithoutCommentInput>
data: Prisma.XOR<Prisma.AgentSessionUpdateWithoutCommentsInput, Prisma.AgentSessionUncheckedUpdateWithoutCommentsInput>
}
export type AgentSessionUpdateWithoutCommentInput = {
export type AgentSessionUpdateWithoutCommentsInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
cwd?: Prisma.StringFieldUpdateOperationsInput | string
leafId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
@@ -613,7 +613,7 @@ export type AgentSessionUpdateWithoutCommentInput = {
entries?: Prisma.AgentSessionEntryUpdateManyWithoutSessionNestedInput
}
export type AgentSessionUncheckedUpdateWithoutCommentInput = {
export type AgentSessionUncheckedUpdateWithoutCommentsInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
agentId?: Prisma.StringFieldUpdateOperationsInput | string
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
@@ -632,7 +632,7 @@ export type AgentSessionCreateWithoutAgentInput = {
updatedAt?: Date | string
user?: Prisma.UserCreateNestedOneWithoutAgentSessionsInput
entries?: Prisma.AgentSessionEntryCreateNestedManyWithoutSessionInput
comment?: Prisma.AssetCommentCreateNestedOneWithoutSessionInput
comments?: Prisma.AssetCommentCreateNestedManyWithoutSessionInput
}
export type AgentSessionUncheckedCreateWithoutAgentInput = {
@@ -643,7 +643,7 @@ export type AgentSessionUncheckedCreateWithoutAgentInput = {
createdAt?: Date | string
updatedAt?: Date | string
entries?: Prisma.AgentSessionEntryUncheckedCreateNestedManyWithoutSessionInput
comment?: Prisma.AssetCommentUncheckedCreateNestedOneWithoutSessionInput
comments?: Prisma.AssetCommentUncheckedCreateNestedManyWithoutSessionInput
}
export type AgentSessionCreateOrConnectWithoutAgentInput = {
@@ -680,7 +680,7 @@ export type AgentSessionCreateWithoutEntriesInput = {
updatedAt?: Date | string
agent: Prisma.AgentCreateNestedOneWithoutAgentSessionsInput
user?: Prisma.UserCreateNestedOneWithoutAgentSessionsInput
comment?: Prisma.AssetCommentCreateNestedOneWithoutSessionInput
comments?: Prisma.AssetCommentCreateNestedManyWithoutSessionInput
}
export type AgentSessionUncheckedCreateWithoutEntriesInput = {
@@ -691,7 +691,7 @@ export type AgentSessionUncheckedCreateWithoutEntriesInput = {
leafId?: string | null
createdAt?: Date | string
updatedAt?: Date | string
comment?: Prisma.AssetCommentUncheckedCreateNestedOneWithoutSessionInput
comments?: Prisma.AssetCommentUncheckedCreateNestedManyWithoutSessionInput
}
export type AgentSessionCreateOrConnectWithoutEntriesInput = {
@@ -718,7 +718,7 @@ export type AgentSessionUpdateWithoutEntriesInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
agent?: Prisma.AgentUpdateOneRequiredWithoutAgentSessionsNestedInput
user?: Prisma.UserUpdateOneWithoutAgentSessionsNestedInput
comment?: Prisma.AssetCommentUpdateOneWithoutSessionNestedInput
comments?: Prisma.AssetCommentUpdateManyWithoutSessionNestedInput
}
export type AgentSessionUncheckedUpdateWithoutEntriesInput = {
@@ -729,7 +729,7 @@ export type AgentSessionUncheckedUpdateWithoutEntriesInput = {
leafId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
comment?: Prisma.AssetCommentUncheckedUpdateOneWithoutSessionNestedInput
comments?: Prisma.AssetCommentUncheckedUpdateManyWithoutSessionNestedInput
}
export type AgentSessionCreateManyUserInput = {
@@ -749,7 +749,7 @@ export type AgentSessionUpdateWithoutUserInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
agent?: Prisma.AgentUpdateOneRequiredWithoutAgentSessionsNestedInput
entries?: Prisma.AgentSessionEntryUpdateManyWithoutSessionNestedInput
comment?: Prisma.AssetCommentUpdateOneWithoutSessionNestedInput
comments?: Prisma.AssetCommentUpdateManyWithoutSessionNestedInput
}
export type AgentSessionUncheckedUpdateWithoutUserInput = {
@@ -760,7 +760,7 @@ export type AgentSessionUncheckedUpdateWithoutUserInput = {
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
entries?: Prisma.AgentSessionEntryUncheckedUpdateManyWithoutSessionNestedInput
comment?: Prisma.AssetCommentUncheckedUpdateOneWithoutSessionNestedInput
comments?: Prisma.AssetCommentUncheckedUpdateManyWithoutSessionNestedInput
}
export type AgentSessionUncheckedUpdateManyWithoutUserInput = {
@@ -789,7 +789,7 @@ export type AgentSessionUpdateWithoutAgentInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
user?: Prisma.UserUpdateOneWithoutAgentSessionsNestedInput
entries?: Prisma.AgentSessionEntryUpdateManyWithoutSessionNestedInput
comment?: Prisma.AssetCommentUpdateOneWithoutSessionNestedInput
comments?: Prisma.AssetCommentUpdateManyWithoutSessionNestedInput
}
export type AgentSessionUncheckedUpdateWithoutAgentInput = {
@@ -800,7 +800,7 @@ export type AgentSessionUncheckedUpdateWithoutAgentInput = {
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
entries?: Prisma.AgentSessionEntryUncheckedUpdateManyWithoutSessionNestedInput
comment?: Prisma.AssetCommentUncheckedUpdateOneWithoutSessionNestedInput
comments?: Prisma.AssetCommentUncheckedUpdateManyWithoutSessionNestedInput
}
export type AgentSessionUncheckedUpdateManyWithoutAgentInput = {
@@ -819,10 +819,12 @@ export type AgentSessionUncheckedUpdateManyWithoutAgentInput = {
export type AgentSessionCountOutputType = {
entries: number
comments: number
}
export type AgentSessionCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
entries?: boolean | AgentSessionCountOutputTypeCountEntriesArgs
comments?: boolean | AgentSessionCountOutputTypeCountCommentsArgs
}
/**
@@ -842,6 +844,13 @@ export type AgentSessionCountOutputTypeCountEntriesArgs<ExtArgs extends runtime.
where?: Prisma.AgentSessionEntryWhereInput
}
/**
* AgentSessionCountOutputType without action
*/
export type AgentSessionCountOutputTypeCountCommentsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.AssetCommentWhereInput
}
export type AgentSessionSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
id?: boolean
@@ -854,7 +863,7 @@ export type AgentSessionSelect<ExtArgs extends runtime.Types.Extensions.Internal
agent?: boolean | Prisma.AgentDefaultArgs<ExtArgs>
user?: boolean | Prisma.AgentSession$userArgs<ExtArgs>
entries?: boolean | Prisma.AgentSession$entriesArgs<ExtArgs>
comment?: boolean | Prisma.AgentSession$commentArgs<ExtArgs>
comments?: boolean | Prisma.AgentSession$commentsArgs<ExtArgs>
_count?: boolean | Prisma.AgentSessionCountOutputTypeDefaultArgs<ExtArgs>
}, ExtArgs["result"]["agentSession"]>
@@ -897,7 +906,7 @@ export type AgentSessionInclude<ExtArgs extends runtime.Types.Extensions.Interna
agent?: boolean | Prisma.AgentDefaultArgs<ExtArgs>
user?: boolean | Prisma.AgentSession$userArgs<ExtArgs>
entries?: boolean | Prisma.AgentSession$entriesArgs<ExtArgs>
comment?: boolean | Prisma.AgentSession$commentArgs<ExtArgs>
comments?: boolean | Prisma.AgentSession$commentsArgs<ExtArgs>
_count?: boolean | Prisma.AgentSessionCountOutputTypeDefaultArgs<ExtArgs>
}
export type AgentSessionIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
@@ -915,7 +924,7 @@ export type $AgentSessionPayload<ExtArgs extends runtime.Types.Extensions.Intern
agent: Prisma.$AgentPayload<ExtArgs>
user: Prisma.$UserPayload<ExtArgs> | null
entries: Prisma.$AgentSessionEntryPayload<ExtArgs>[]
comment: Prisma.$AssetCommentPayload<ExtArgs> | null
comments: Prisma.$AssetCommentPayload<ExtArgs>[]
}
scalars: runtime.Types.Extensions.GetPayloadResult<{
id: string
@@ -1322,7 +1331,7 @@ export interface Prisma__AgentSessionClient<T, Null = never, ExtArgs extends run
agent<T extends Prisma.AgentDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.AgentDefaultArgs<ExtArgs>>): Prisma.Prisma__AgentClient<runtime.Types.Result.GetResult<Prisma.$AgentPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
user<T extends Prisma.AgentSession$userArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.AgentSession$userArgs<ExtArgs>>): Prisma.Prisma__UserClient<runtime.Types.Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
entries<T extends Prisma.AgentSession$entriesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.AgentSession$entriesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$AgentSessionEntryPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
comment<T extends Prisma.AgentSession$commentArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.AgentSession$commentArgs<ExtArgs>>): Prisma.Prisma__AssetCommentClient<runtime.Types.Result.GetResult<Prisma.$AssetCommentPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
comments<T extends Prisma.AgentSession$commentsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.AgentSession$commentsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$AssetCommentPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
@@ -1803,9 +1812,9 @@ export type AgentSession$entriesArgs<ExtArgs extends runtime.Types.Extensions.In
}
/**
* AgentSession.comment
* AgentSession.comments
*/
export type AgentSession$commentArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
export type AgentSession$commentsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the AssetComment
*/
@@ -1819,6 +1828,11 @@ export type AgentSession$commentArgs<ExtArgs extends runtime.Types.Extensions.In
*/
include?: Prisma.AssetCommentInclude<ExtArgs> | null
where?: Prisma.AssetCommentWhereInput
orderBy?: Prisma.AssetCommentOrderByWithRelationInput | Prisma.AssetCommentOrderByWithRelationInput[]
cursor?: Prisma.AssetCommentWhereUniqueInput
take?: number
skip?: number
distinct?: Prisma.AssetCommentScalarFieldEnum | Prisma.AssetCommentScalarFieldEnum[]
}
/**
+114 -70
View File
@@ -283,13 +283,13 @@ export type AssetCommentOrderByWithRelationInput = {
export type AssetCommentWhereUniqueInput = Prisma.AtLeast<{
id?: string
sessionId?: string
AND?: Prisma.AssetCommentWhereInput | Prisma.AssetCommentWhereInput[]
OR?: Prisma.AssetCommentWhereInput[]
NOT?: Prisma.AssetCommentWhereInput | Prisma.AssetCommentWhereInput[]
message?: Prisma.StringNullableFilter<"AssetComment"> | string | null
annotation?: Prisma.JsonNullableFilter<"AssetComment">
second?: Prisma.FloatNullableFilter<"AssetComment"> | number | null
sessionId?: Prisma.StringNullableFilter<"AssetComment"> | string | null
createdAt?: Prisma.DateTimeFilter<"AssetComment"> | Date | string
updatedAt?: Prisma.DateTimeFilter<"AssetComment"> | Date | string
assetId?: Prisma.StringFilter<"AssetComment"> | string
@@ -301,7 +301,7 @@ export type AssetCommentWhereUniqueInput = Prisma.AtLeast<{
replyTo?: Prisma.XOR<Prisma.AssetCommentNullableScalarRelationFilter, Prisma.AssetCommentWhereInput> | null
replies?: Prisma.AssetCommentListRelationFilter
attachments?: Prisma.AssetCommentAttachmentListRelationFilter
}, "id" | "sessionId">
}, "id">
export type AssetCommentOrderByWithAggregationInput = {
id?: Prisma.SortOrder
@@ -344,7 +344,7 @@ export type AssetCommentCreateInput = {
second?: number | null
createdAt?: Date | string
updatedAt?: Date | string
session?: Prisma.AgentSessionCreateNestedOneWithoutCommentInput
session?: Prisma.AgentSessionCreateNestedOneWithoutCommentsInput
asset: Prisma.AssetCreateNestedOneWithoutCommentsInput
creator?: Prisma.UserCreateNestedOneWithoutCommentsInput
replyTo?: Prisma.AssetCommentCreateNestedOneWithoutRepliesInput
@@ -374,7 +374,7 @@ export type AssetCommentUpdateInput = {
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
session?: Prisma.AgentSessionUpdateOneWithoutCommentNestedInput
session?: Prisma.AgentSessionUpdateOneWithoutCommentsNestedInput
asset?: Prisma.AssetUpdateOneRequiredWithoutCommentsNestedInput
creator?: Prisma.UserUpdateOneWithoutCommentsNestedInput
replyTo?: Prisma.AssetCommentUpdateOneWithoutRepliesNestedInput
@@ -653,36 +653,46 @@ export type AssetCommentUpdateOneRequiredWithoutAttachmentsNestedInput = {
update?: Prisma.XOR<Prisma.XOR<Prisma.AssetCommentUpdateToOneWithWhereWithoutAttachmentsInput, Prisma.AssetCommentUpdateWithoutAttachmentsInput>, Prisma.AssetCommentUncheckedUpdateWithoutAttachmentsInput>
}
export type AssetCommentCreateNestedOneWithoutSessionInput = {
create?: Prisma.XOR<Prisma.AssetCommentCreateWithoutSessionInput, Prisma.AssetCommentUncheckedCreateWithoutSessionInput>
connectOrCreate?: Prisma.AssetCommentCreateOrConnectWithoutSessionInput
connect?: Prisma.AssetCommentWhereUniqueInput
export type AssetCommentCreateNestedManyWithoutSessionInput = {
create?: Prisma.XOR<Prisma.AssetCommentCreateWithoutSessionInput, Prisma.AssetCommentUncheckedCreateWithoutSessionInput> | Prisma.AssetCommentCreateWithoutSessionInput[] | Prisma.AssetCommentUncheckedCreateWithoutSessionInput[]
connectOrCreate?: Prisma.AssetCommentCreateOrConnectWithoutSessionInput | Prisma.AssetCommentCreateOrConnectWithoutSessionInput[]
createMany?: Prisma.AssetCommentCreateManySessionInputEnvelope
connect?: Prisma.AssetCommentWhereUniqueInput | Prisma.AssetCommentWhereUniqueInput[]
}
export type AssetCommentUncheckedCreateNestedOneWithoutSessionInput = {
create?: Prisma.XOR<Prisma.AssetCommentCreateWithoutSessionInput, Prisma.AssetCommentUncheckedCreateWithoutSessionInput>
connectOrCreate?: Prisma.AssetCommentCreateOrConnectWithoutSessionInput
connect?: Prisma.AssetCommentWhereUniqueInput
export type AssetCommentUncheckedCreateNestedManyWithoutSessionInput = {
create?: Prisma.XOR<Prisma.AssetCommentCreateWithoutSessionInput, Prisma.AssetCommentUncheckedCreateWithoutSessionInput> | Prisma.AssetCommentCreateWithoutSessionInput[] | Prisma.AssetCommentUncheckedCreateWithoutSessionInput[]
connectOrCreate?: Prisma.AssetCommentCreateOrConnectWithoutSessionInput | Prisma.AssetCommentCreateOrConnectWithoutSessionInput[]
createMany?: Prisma.AssetCommentCreateManySessionInputEnvelope
connect?: Prisma.AssetCommentWhereUniqueInput | Prisma.AssetCommentWhereUniqueInput[]
}
export type AssetCommentUpdateOneWithoutSessionNestedInput = {
create?: Prisma.XOR<Prisma.AssetCommentCreateWithoutSessionInput, Prisma.AssetCommentUncheckedCreateWithoutSessionInput>
connectOrCreate?: Prisma.AssetCommentCreateOrConnectWithoutSessionInput
upsert?: Prisma.AssetCommentUpsertWithoutSessionInput
disconnect?: Prisma.AssetCommentWhereInput | boolean
delete?: Prisma.AssetCommentWhereInput | boolean
connect?: Prisma.AssetCommentWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.AssetCommentUpdateToOneWithWhereWithoutSessionInput, Prisma.AssetCommentUpdateWithoutSessionInput>, Prisma.AssetCommentUncheckedUpdateWithoutSessionInput>
export type AssetCommentUpdateManyWithoutSessionNestedInput = {
create?: Prisma.XOR<Prisma.AssetCommentCreateWithoutSessionInput, Prisma.AssetCommentUncheckedCreateWithoutSessionInput> | Prisma.AssetCommentCreateWithoutSessionInput[] | Prisma.AssetCommentUncheckedCreateWithoutSessionInput[]
connectOrCreate?: Prisma.AssetCommentCreateOrConnectWithoutSessionInput | Prisma.AssetCommentCreateOrConnectWithoutSessionInput[]
upsert?: Prisma.AssetCommentUpsertWithWhereUniqueWithoutSessionInput | Prisma.AssetCommentUpsertWithWhereUniqueWithoutSessionInput[]
createMany?: Prisma.AssetCommentCreateManySessionInputEnvelope
set?: Prisma.AssetCommentWhereUniqueInput | Prisma.AssetCommentWhereUniqueInput[]
disconnect?: Prisma.AssetCommentWhereUniqueInput | Prisma.AssetCommentWhereUniqueInput[]
delete?: Prisma.AssetCommentWhereUniqueInput | Prisma.AssetCommentWhereUniqueInput[]
connect?: Prisma.AssetCommentWhereUniqueInput | Prisma.AssetCommentWhereUniqueInput[]
update?: Prisma.AssetCommentUpdateWithWhereUniqueWithoutSessionInput | Prisma.AssetCommentUpdateWithWhereUniqueWithoutSessionInput[]
updateMany?: Prisma.AssetCommentUpdateManyWithWhereWithoutSessionInput | Prisma.AssetCommentUpdateManyWithWhereWithoutSessionInput[]
deleteMany?: Prisma.AssetCommentScalarWhereInput | Prisma.AssetCommentScalarWhereInput[]
}
export type AssetCommentUncheckedUpdateOneWithoutSessionNestedInput = {
create?: Prisma.XOR<Prisma.AssetCommentCreateWithoutSessionInput, Prisma.AssetCommentUncheckedCreateWithoutSessionInput>
connectOrCreate?: Prisma.AssetCommentCreateOrConnectWithoutSessionInput
upsert?: Prisma.AssetCommentUpsertWithoutSessionInput
disconnect?: Prisma.AssetCommentWhereInput | boolean
delete?: Prisma.AssetCommentWhereInput | boolean
connect?: Prisma.AssetCommentWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.AssetCommentUpdateToOneWithWhereWithoutSessionInput, Prisma.AssetCommentUpdateWithoutSessionInput>, Prisma.AssetCommentUncheckedUpdateWithoutSessionInput>
export type AssetCommentUncheckedUpdateManyWithoutSessionNestedInput = {
create?: Prisma.XOR<Prisma.AssetCommentCreateWithoutSessionInput, Prisma.AssetCommentUncheckedCreateWithoutSessionInput> | Prisma.AssetCommentCreateWithoutSessionInput[] | Prisma.AssetCommentUncheckedCreateWithoutSessionInput[]
connectOrCreate?: Prisma.AssetCommentCreateOrConnectWithoutSessionInput | Prisma.AssetCommentCreateOrConnectWithoutSessionInput[]
upsert?: Prisma.AssetCommentUpsertWithWhereUniqueWithoutSessionInput | Prisma.AssetCommentUpsertWithWhereUniqueWithoutSessionInput[]
createMany?: Prisma.AssetCommentCreateManySessionInputEnvelope
set?: Prisma.AssetCommentWhereUniqueInput | Prisma.AssetCommentWhereUniqueInput[]
disconnect?: Prisma.AssetCommentWhereUniqueInput | Prisma.AssetCommentWhereUniqueInput[]
delete?: Prisma.AssetCommentWhereUniqueInput | Prisma.AssetCommentWhereUniqueInput[]
connect?: Prisma.AssetCommentWhereUniqueInput | Prisma.AssetCommentWhereUniqueInput[]
update?: Prisma.AssetCommentUpdateWithWhereUniqueWithoutSessionInput | Prisma.AssetCommentUpdateWithWhereUniqueWithoutSessionInput[]
updateMany?: Prisma.AssetCommentUpdateManyWithWhereWithoutSessionInput | Prisma.AssetCommentUpdateManyWithWhereWithoutSessionInput[]
deleteMany?: Prisma.AssetCommentScalarWhereInput | Prisma.AssetCommentScalarWhereInput[]
}
export type AssetCommentCreateWithoutCreatorInput = {
@@ -692,7 +702,7 @@ export type AssetCommentCreateWithoutCreatorInput = {
second?: number | null
createdAt?: Date | string
updatedAt?: Date | string
session?: Prisma.AgentSessionCreateNestedOneWithoutCommentInput
session?: Prisma.AgentSessionCreateNestedOneWithoutCommentsInput
asset: Prisma.AssetCreateNestedOneWithoutCommentsInput
replyTo?: Prisma.AssetCommentCreateNestedOneWithoutRepliesInput
replies?: Prisma.AssetCommentCreateNestedManyWithoutReplyToInput
@@ -762,7 +772,7 @@ export type AssetCommentCreateWithoutAssetInput = {
second?: number | null
createdAt?: Date | string
updatedAt?: Date | string
session?: Prisma.AgentSessionCreateNestedOneWithoutCommentInput
session?: Prisma.AgentSessionCreateNestedOneWithoutCommentsInput
creator?: Prisma.UserCreateNestedOneWithoutCommentsInput
replyTo?: Prisma.AssetCommentCreateNestedOneWithoutRepliesInput
replies?: Prisma.AssetCommentCreateNestedManyWithoutReplyToInput
@@ -816,7 +826,7 @@ export type AssetCommentCreateWithoutRepliesInput = {
second?: number | null
createdAt?: Date | string
updatedAt?: Date | string
session?: Prisma.AgentSessionCreateNestedOneWithoutCommentInput
session?: Prisma.AgentSessionCreateNestedOneWithoutCommentsInput
asset: Prisma.AssetCreateNestedOneWithoutCommentsInput
creator?: Prisma.UserCreateNestedOneWithoutCommentsInput
replyTo?: Prisma.AssetCommentCreateNestedOneWithoutRepliesInput
@@ -849,7 +859,7 @@ export type AssetCommentCreateWithoutReplyToInput = {
second?: number | null
createdAt?: Date | string
updatedAt?: Date | string
session?: Prisma.AgentSessionCreateNestedOneWithoutCommentInput
session?: Prisma.AgentSessionCreateNestedOneWithoutCommentsInput
asset: Prisma.AssetCreateNestedOneWithoutCommentsInput
creator?: Prisma.UserCreateNestedOneWithoutCommentsInput
replies?: Prisma.AssetCommentCreateNestedManyWithoutReplyToInput
@@ -898,7 +908,7 @@ export type AssetCommentUpdateWithoutRepliesInput = {
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
session?: Prisma.AgentSessionUpdateOneWithoutCommentNestedInput
session?: Prisma.AgentSessionUpdateOneWithoutCommentsNestedInput
asset?: Prisma.AssetUpdateOneRequiredWithoutCommentsNestedInput
creator?: Prisma.UserUpdateOneWithoutCommentsNestedInput
replyTo?: Prisma.AssetCommentUpdateOneWithoutRepliesNestedInput
@@ -942,7 +952,7 @@ export type AssetCommentCreateWithoutAttachmentsInput = {
second?: number | null
createdAt?: Date | string
updatedAt?: Date | string
session?: Prisma.AgentSessionCreateNestedOneWithoutCommentInput
session?: Prisma.AgentSessionCreateNestedOneWithoutCommentsInput
asset: Prisma.AssetCreateNestedOneWithoutCommentsInput
creator?: Prisma.UserCreateNestedOneWithoutCommentsInput
replyTo?: Prisma.AssetCommentCreateNestedOneWithoutRepliesInput
@@ -986,7 +996,7 @@ export type AssetCommentUpdateWithoutAttachmentsInput = {
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
session?: Prisma.AgentSessionUpdateOneWithoutCommentNestedInput
session?: Prisma.AgentSessionUpdateOneWithoutCommentsNestedInput
asset?: Prisma.AssetUpdateOneRequiredWithoutCommentsNestedInput
creator?: Prisma.UserUpdateOneWithoutCommentsNestedInput
replyTo?: Prisma.AssetCommentUpdateOneWithoutRepliesNestedInput
@@ -1040,43 +1050,25 @@ export type AssetCommentCreateOrConnectWithoutSessionInput = {
create: Prisma.XOR<Prisma.AssetCommentCreateWithoutSessionInput, Prisma.AssetCommentUncheckedCreateWithoutSessionInput>
}
export type AssetCommentUpsertWithoutSessionInput = {
update: Prisma.XOR<Prisma.AssetCommentUpdateWithoutSessionInput, Prisma.AssetCommentUncheckedUpdateWithoutSessionInput>
create: Prisma.XOR<Prisma.AssetCommentCreateWithoutSessionInput, Prisma.AssetCommentUncheckedCreateWithoutSessionInput>
where?: Prisma.AssetCommentWhereInput
export type AssetCommentCreateManySessionInputEnvelope = {
data: Prisma.AssetCommentCreateManySessionInput | Prisma.AssetCommentCreateManySessionInput[]
skipDuplicates?: boolean
}
export type AssetCommentUpdateToOneWithWhereWithoutSessionInput = {
where?: Prisma.AssetCommentWhereInput
export type AssetCommentUpsertWithWhereUniqueWithoutSessionInput = {
where: Prisma.AssetCommentWhereUniqueInput
update: Prisma.XOR<Prisma.AssetCommentUpdateWithoutSessionInput, Prisma.AssetCommentUncheckedUpdateWithoutSessionInput>
create: Prisma.XOR<Prisma.AssetCommentCreateWithoutSessionInput, Prisma.AssetCommentUncheckedCreateWithoutSessionInput>
}
export type AssetCommentUpdateWithWhereUniqueWithoutSessionInput = {
where: Prisma.AssetCommentWhereUniqueInput
data: Prisma.XOR<Prisma.AssetCommentUpdateWithoutSessionInput, Prisma.AssetCommentUncheckedUpdateWithoutSessionInput>
}
export type AssetCommentUpdateWithoutSessionInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
asset?: Prisma.AssetUpdateOneRequiredWithoutCommentsNestedInput
creator?: Prisma.UserUpdateOneWithoutCommentsNestedInput
replyTo?: Prisma.AssetCommentUpdateOneWithoutRepliesNestedInput
replies?: Prisma.AssetCommentUpdateManyWithoutReplyToNestedInput
attachments?: Prisma.AssetCommentAttachmentUpdateManyWithoutCommentNestedInput
}
export type AssetCommentUncheckedUpdateWithoutSessionInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
assetId?: Prisma.StringFieldUpdateOperationsInput | string
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
replyToId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
replies?: Prisma.AssetCommentUncheckedUpdateManyWithoutReplyToNestedInput
attachments?: Prisma.AssetCommentAttachmentUncheckedUpdateManyWithoutCommentNestedInput
export type AssetCommentUpdateManyWithWhereWithoutSessionInput = {
where: Prisma.AssetCommentScalarWhereInput
data: Prisma.XOR<Prisma.AssetCommentUpdateManyMutationInput, Prisma.AssetCommentUncheckedUpdateManyWithoutSessionInput>
}
export type AssetCommentCreateManyCreatorInput = {
@@ -1098,7 +1090,7 @@ export type AssetCommentUpdateWithoutCreatorInput = {
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
session?: Prisma.AgentSessionUpdateOneWithoutCommentNestedInput
session?: Prisma.AgentSessionUpdateOneWithoutCommentsNestedInput
asset?: Prisma.AssetUpdateOneRequiredWithoutCommentsNestedInput
replyTo?: Prisma.AssetCommentUpdateOneWithoutRepliesNestedInput
replies?: Prisma.AssetCommentUpdateManyWithoutReplyToNestedInput
@@ -1150,7 +1142,7 @@ export type AssetCommentUpdateWithoutAssetInput = {
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
session?: Prisma.AgentSessionUpdateOneWithoutCommentNestedInput
session?: Prisma.AgentSessionUpdateOneWithoutCommentsNestedInput
creator?: Prisma.UserUpdateOneWithoutCommentsNestedInput
replyTo?: Prisma.AssetCommentUpdateOneWithoutRepliesNestedInput
replies?: Prisma.AssetCommentUpdateManyWithoutReplyToNestedInput
@@ -1202,7 +1194,7 @@ export type AssetCommentUpdateWithoutReplyToInput = {
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
session?: Prisma.AgentSessionUpdateOneWithoutCommentNestedInput
session?: Prisma.AgentSessionUpdateOneWithoutCommentsNestedInput
asset?: Prisma.AssetUpdateOneRequiredWithoutCommentsNestedInput
creator?: Prisma.UserUpdateOneWithoutCommentsNestedInput
replies?: Prisma.AssetCommentUpdateManyWithoutReplyToNestedInput
@@ -1235,6 +1227,58 @@ export type AssetCommentUncheckedUpdateManyWithoutReplyToInput = {
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}
export type AssetCommentCreateManySessionInput = {
id?: string
message?: string | null
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
second?: number | null
createdAt?: Date | string
updatedAt?: Date | string
assetId: string
creatorId?: string | null
replyToId?: string | null
}
export type AssetCommentUpdateWithoutSessionInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
asset?: Prisma.AssetUpdateOneRequiredWithoutCommentsNestedInput
creator?: Prisma.UserUpdateOneWithoutCommentsNestedInput
replyTo?: Prisma.AssetCommentUpdateOneWithoutRepliesNestedInput
replies?: Prisma.AssetCommentUpdateManyWithoutReplyToNestedInput
attachments?: Prisma.AssetCommentAttachmentUpdateManyWithoutCommentNestedInput
}
export type AssetCommentUncheckedUpdateWithoutSessionInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
assetId?: Prisma.StringFieldUpdateOperationsInput | string
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
replyToId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
replies?: Prisma.AssetCommentUncheckedUpdateManyWithoutReplyToNestedInput
attachments?: Prisma.AssetCommentAttachmentUncheckedUpdateManyWithoutCommentNestedInput
}
export type AssetCommentUncheckedUpdateManyWithoutSessionInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
assetId?: Prisma.StringFieldUpdateOperationsInput | string
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
replyToId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}
/**
* Count Type AssetCommentCountOutputType
+41
View File
@@ -53,6 +53,47 @@ describe('Database Activities', () => {
expect(found).toBeNull()
})
it('should support multiple comments in the same session without violating unique session_id constraint', async () => {
const team = await prisma.team.create({ data: { name: 't2' } })
const user = await prisma.user.create({
data: { name: 'User Two', email: 'user2@example.com' },
})
const project = await prisma.project.create({
data: { name: 'p2', teamId: team.id },
})
const file = await prisma.asset.create({
data: {
name: 'test-file-2',
type: 'file',
projectId: project.id,
creatorId: user.id,
status: 'uploaded',
},
})
const sessionId = 'test-multi-comment-session'
// 1. Create first agent comment in the session
const c1 = await createCommentActivity({
assetId: file.id,
message: 'Agent comment 1',
sessionId,
agentId: 'default',
})
expect(c1.id).toBeDefined()
expect(c1.sessionId).toBe(sessionId)
// 2. Create second agent comment in the SAME session
const c2 = await createCommentActivity({
assetId: file.id,
message: 'Agent comment 2',
sessionId,
agentId: 'default',
})
expect(c2.id).toBeDefined()
expect(c2.sessionId).toBe(sessionId)
})
it('should initialize a new session with chronological context, prefixed usernames, and resolved user mentions', async () => {
const team = await prisma.team.create({ data: { name: 't1' } })
const user1 = await prisma.user.create({