File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -50,12 +50,12 @@ export async function getChat(docsId: string) {
5050 include : {
5151 messages : {
5252 orderBy : {
53- id : "asc" ,
53+ createdAt : "asc" ,
5454 } ,
5555 } ,
5656 } ,
5757 orderBy : {
58- chatId : "asc" ,
58+ createdAt : "asc" ,
5959 } ,
6060 } ) ;
6161}
Original file line number Diff line number Diff line change @@ -81,19 +81,21 @@ model Verification {
8181// ここまでbetter-authが使う
8282
8383model Chat {
84- chatId Int @id @default (autoincrement () )
84+ chatId String @id @default (uuid () )
8585 userId String
8686 user User @relation (fields : [userId ] , references : [id ] , onDelete : Cascade )
8787 docsId String
8888 sectionId String
89+ createdAt DateTime @default (now () )
8990
9091 messages Message []
9192}
9293
9394model Message {
94- id Int @id @default (autoincrement () )
95- chatId Int
95+ id String @id @default (uuid () )
96+ chatId String
9697 chat Chat @relation (fields : [chatId ] , references : [chatId ] , onDelete : Cascade )
9798 role String
9899 content String
100+ createdAt DateTime @default (now () )
99101}
You can’t perform that action at this time.
0 commit comments