@@ -35,7 +35,7 @@ datasource db {
3535
3636 extensions = [vector ]
3737
38- schemas = [" public " , " auth " , " customer " , " payment " , " llm " , " poketto " , " wechat " , " assistant " ]
38+ schemas = [" public " , " auth " , " customer " , " payment " , " llm " , " poketto " , " wechat " , " assistant " , " social-platform " , " totem-gpt " ]
3939}
4040
4141// -----------------------------------------------------------------------------
@@ -147,12 +147,15 @@ model User {
147147 // 每日需要更新
148148
149149 /// [ModelQuota]
150- quota Json ?
151- feedbacks Feedback []
152- appCategories PokettoAppCategory []
153- coupons Coupon []
154- evalApps EvalApp []
155- evalConvs Conv []
150+ quota Json ?
151+ feedbacks Feedback []
152+ appCategories PokettoAppCategory []
153+ coupons Coupon []
154+ evalApps EvalApp []
155+ evalConvs Conv []
156+ SocialPlatformAuth SocialPlatformAuth []
157+ TotemGPTGenRequest TotemGenRequest []
158+ TotemGenResponseActions TotemGenResponseActions []
156159
157160 // maybe we only need one id
158161 @@unique ([platformType , platformId ] , name : " platform " )
@@ -976,3 +979,131 @@ model Task {
976979
977980 @@schema (" assistant " )
978981}
982+
983+ // -----------------------------------------------------------------------------
984+ // totem-gpt
985+ // -----------------------------------------------------------------------------
986+ model TotemGenRequest {
987+ id String @id @default (dbgenerated (" nanoid (7 )" ) )
988+
989+ createdAt DateTime @default (now () )
990+ updatedAt DateTime @updatedAt
991+
992+ user User @relation (fields : [userId ] , references : [id ] )
993+ userId String @db.VarChar (7 )
994+
995+ prompt String
996+ response TotemGenResponse []
997+
998+ @@schema (" totem-gpt " )
999+ }
1000+
1001+ enum SseStatus {
1002+ preparing
1003+ running
1004+ interrupted
1005+ finished
1006+
1007+ @@schema (" public " )
1008+ }
1009+
1010+ model TotemGenResponse {
1011+ id String @id @default (dbgenerated (" nanoid (7 )" ) )
1012+ createdAt DateTime @default (now () )
1013+ updatedAt DateTime @updatedAt
1014+
1015+ request TotemGenRequest @relation (fields : [requestId ] , references : [id ] )
1016+ requestId String
1017+
1018+ status SseStatus @default (preparing )
1019+ stream String
1020+ TotemGenResponseActions TotemGenResponseActions []
1021+
1022+ @@schema (" totem-gpt " )
1023+ }
1024+
1025+ model TotemGenResponseActions {
1026+ id String @id @default (dbgenerated (" nanoid (7 )" ) )
1027+ createdAt DateTime @default (now () )
1028+ updatedAt DateTime @updatedAt
1029+
1030+ response TotemGenResponse @relation (fields : [responseId ] , references : [id ] )
1031+ responseId String
1032+
1033+ user User @relation (fields : [userId ] , references : [id ] )
1034+ userId String @db.VarChar (7 )
1035+
1036+ type String
1037+ detail String ?
1038+
1039+ @@schema (" totem-gpt " )
1040+ }
1041+
1042+ // -----------------------------------------------------------------------------
1043+ // social-platform
1044+ // -----------------------------------------------------------------------------
1045+
1046+ model SocialPlatform {
1047+ id String @id
1048+ title String
1049+ description String
1050+ icon String
1051+ SocialPlatformAuth SocialPlatformAuth []
1052+
1053+ @@schema (" social-platform " )
1054+ }
1055+
1056+ model SocialPlatformAuth {
1057+ id String @id @default (dbgenerated (" nanoid (7 )" ) ) @db.VarChar (7 )
1058+ user User @relation (fields : [userId ] , references : [id ] )
1059+ userId String
1060+
1061+ socialPlatform SocialPlatform @relation (fields : [socialPlatformId ] , references : [id ] )
1062+ socialPlatformId String
1063+
1064+ isLoggedIn Boolean @default (false )
1065+ // cookie, sms, mail ...
1066+ options Json ?
1067+ events SocialPlatformEvent []
1068+ SocialPlatformPost SocialPlatformPost []
1069+
1070+ @@schema (" social-platform " )
1071+ }
1072+
1073+ model SocialPlatformEvent {
1074+ id String @id @default (dbgenerated (" nanoid (7 )" ) )
1075+
1076+ createdAt DateTime @default (now () )
1077+ updatedAt DateTime @updatedAt
1078+
1079+ // login / logout / CRUD / comment ...
1080+ type String
1081+ payload Json ?
1082+
1083+ auth SocialPlatformAuth @relation (fields : [authId ] , references : [id ] )
1084+ authId String
1085+
1086+ @@schema (" social-platform " )
1087+ }
1088+
1089+ model SocialPlatformPost {
1090+ id String @id @default (dbgenerated (" nanoid (7 )" ) )
1091+
1092+ createdAt DateTime @default (now () )
1093+ updatedAt DateTime @updatedAt
1094+
1095+ auth SocialPlatformAuth @relation (fields : [authId ] , references : [id ] )
1096+ authId String
1097+
1098+ text String ?
1099+ images Json ?
1100+ audios Json ?
1101+ vidios Json ?
1102+ files Json ?
1103+ location Json ?
1104+ permissions Json ?
1105+
1106+ publishTime DateTime ?
1107+
1108+ @@schema (" social-platform " )
1109+ }
0 commit comments