forked from wishonia/wishonia
-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.prisma
2229 lines (1995 loc) · 75 KB
/
schema.prisma
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
generator client {
provider = "prisma-client-js"
// Had to comment because I keep getting the error:
// Changed the `vector` extension. need to reset the "public" schema
// previewFeatures = ["postgresqlExtensions"]
// extensions = ["(function)"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
// extensions = [uuid_ossp(map: "uuid-ossp", schema: "public")]
}
model Account {
id String @id @default(cuid())
userId String @map("user_id")
type String
provider String
providerAccountId String @map("provider_account_id")
refresh_token String?
access_token String?
expires_at Int?
token_type String?
scope String?
id_token String?
session_state String?
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@unique([provider, providerAccountId])
@@map("accounts")
}
model Session {
id String @id @default(cuid())
sessionToken String @unique @map("session_token")
userId String @map("user_id")
expires DateTime
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@map("sessions")
}
model User {
id String @id @default(cuid())
address String?
badges Json?
banned Boolean?
bio String?
birthday DateTime?
blog String?
city String?
company String?
contributorsEnabled Boolean?
countryCode String?
createdAt DateTime @default(now())
createdAtTwitter DateTime?
deletedAt DateTime?
email String? @unique
emailVerified DateTime?
favouritesCount Int?
firstName String?
followersCount Int?
followingCount Int?
gdprConsent Boolean @default(false)
gender String?
geoEnabled Boolean?
githubUsername String?
hireable Boolean?
image String?
ipAddress String? @db.VarChar(45)
language String?
lastName String?
lastSignInAt BigInt?
likeCount Int?
listedCount Int?
location String?
name String?
newsletterSubscribed Boolean @default(false)
phoneNumber String?
points Int?
postalCode String?
privateMetadata Json?
profileBannerUrl String?
protected Boolean?
publicMetadata Json?
referrerUserId String?
signatureTimestamp DateTime @default(now())
signedPetition Boolean @default(false)
stateProvince String?
statusesCount Int?
timeZone String?
tweetCount Int?
twitterHandle String?
type String?
unsafeMetadata Json?
updatedAt DateTime @updatedAt
username String @unique @default(uuid())
verified Boolean?
warPercentageDesired Float?
warPercentageGuessed Float?
web3Wallet String?
website String?
admin Boolean? @default(false)
activities Activity[]
agents Agent[]
apiKeys ApiKey[]
chats Chat[]
comments Comment[]
datasources Datasource[]
educations Education[]
endorsements Endorsement[]
receivedFriendships Friendship[] @relation("ReceiverFriendships")
initiatedFriendships Friendship[] @relation("InitiatorFriendships")
createdGenieDAOs GenieDAO[] @relation("CreatedGenieDAOs")
genieDAOFeedback GenieDAOFeedback[]
globalProblems GlobalProblem[]
globalProblemPairAllocations GlobalProblemPairAllocation[]
globalProblemSolutionsPairAllocations GlobalProblemSolutionPairAllocation[]
globalSolutions GlobalSolution[]
globalSolutionPairAllocations GlobalSolutionPairAllocation[]
globalTasksCreated GlobalTask[]
llms LLM[]
likes Like[]
positions Position[]
posts Post[]
proposalComparisons ProposalComparison[]
createdProposalProgressReports ProposalProgressReport[]
recommenderRecommendations Recommendation[] @relation("RecommenderRecommendations")
userRecommendations Recommendation[] @relation("UserRecommendations")
tools Tool[]
userSkills UserSkill[]
userTasks UserTask[]
vectorDb VectorDb[]
createdWishFulfillmentProposals WishFulfillmentProposal[] @relation("CreatedProposals")
wishingWells WishingWell[]
wishingWellPairAllocations WishingWellPairAllocation[]
workflows Workflow[]
workflowConfigs WorkflowConfig[]
accounts Account[]
sessions Session[]
joinedGenieDAOs GenieDAO[] @relation("JoinedGenieDAOs")
globalTaskAttachment GlobalTaskAttachment[]
globalTaskComment GlobalTaskComment[]
userTaskComment UserTaskComment[]
userTaskAttachment UserTaskAttachment[]
person Person?
personId String?
conditionReports DfdaUserConditionReport[]
symptomReports DfdaUserSymptomReport[]
treatmentReports DfdaUserTreatmentReport[]
sideEffectReports DfdaUserSideEffectReport[]
authoredArticles Article[]
articleComments ArticleComment[]
ownedOrganizations Organization[]
organizationFollows OrganizationFollower[]
StripeCustomer StripeCustomer?
createdPetitions Petition[] @relation("CreatedPetitions")
petitionSignatures PetitionSignature[]
referredSignatures PetitionSignature[] @relation("ReferredSignatures")
petitionComments PetitionComment[]
petitionFollows PetitionFollow[]
repMessages PetitionRepMessage[]
marketingEmails Boolean @default(false)
newsletterEmails Boolean @default(false)
unsubscribeFromAll Boolean @default(false)
callSchedulesCreated CallSchedule[]
}
// Need this to create digital twins for people that are not users
model Person {
id String @id @default(cuid())
bio String?
birthday DateTime?
blog String?
city String?
company String?
createdAt DateTime @default(now())
createdAtTwitter DateTime?
email String? @unique
firstName String?
gender String?
githubUsername String? @unique
hireable Boolean?
image String?
jobTitle String?
lastName String?
location String?
memberships OrganizationMembership[]
name String
phoneNumber String? @unique
postalCode String?
profileBannerUrl String?
stateProvince String?
telephone String?
timeZone String?
twitterHandle String? @unique
updatedAt DateTime @updatedAt
user User? @relation(fields: [userId], references: [id])
userId String? @unique
web3Wallet String? @unique
website String?
callSchedules CallSchedule[]
globalProblems PersonGlobalProblem[]
globalSolutions PersonGlobalSolution[]
callSummaryRecipients CallSummaryRecipient[]
// Add index for common queries
@@index([name])
@@index([email])
@@index([phoneNumber])
}
model Education {
id String @id @default(cuid())
userId String
school String
degree String?
fieldOfStudy String?
startDate DateTime
endDate DateTime?
user User @relation(fields: [userId], references: [id])
}
model Position {
id String @id @default(cuid())
userId String
title String
company String
startDate DateTime
endDate DateTime?
isCurrent Boolean
user User @relation(fields: [userId], references: [id])
}
model UserSkill {
id String @id @default(cuid())
userId String
skillId String
endorsements Endorsement[]
skill Skill @relation(fields: [skillId], references: [id])
user User @relation(fields: [userId], references: [id])
@@unique([userId, skillId])
}
model OrganizationSkill {
id String @id @default(cuid())
organizationId String
skillId String
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
skill Skill @relation(fields: [skillId], references: [id])
@@unique([organizationId, skillId])
}
model GrantSkill {
id String @id @default(cuid())
grantId String
skillId String
grant Grant @relation(fields: [grantId], references: [id])
skill Skill @relation(fields: [skillId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([grantId, skillId])
}
model Skill {
id String @id @default(cuid())
name String @unique
globalTasks GlobalTaskSkill[]
userSkills UserSkill[]
organizationSkills OrganizationSkill[]
grantSkills GrantSkill[]
}
model Endorsement {
id String @id @default(cuid())
userId String
userSkillId String?
user User @relation(fields: [userId], references: [id])
userSkill UserSkill? @relation(fields: [userSkillId], references: [id])
}
model Recommendation {
id String @id @default(cuid())
userId String
recommenderId String
text String
recommender User @relation("RecommenderRecommendations", fields: [recommenderId], references: [id])
user User @relation("UserRecommendations", fields: [userId], references: [id])
}
model Post {
id String @id @default(cuid())
userId String
content String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
comments Comment[]
likes Like[]
user User @relation(fields: [userId], references: [id])
}
model Like {
id String @id @default(cuid())
userId String
postId String
post Post @relation(fields: [postId], references: [id])
user User @relation(fields: [userId], references: [id])
}
model Comment {
id String @id @default(cuid())
userId String
postId String
content String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
post Post @relation(fields: [postId], references: [id])
user User @relation(fields: [userId], references: [id])
}
model Friendship {
id String @id @default(cuid())
userId String
friendId String
status String @default("pending")
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
friend User @relation("ReceiverFriendships", fields: [friendId], references: [id])
user User @relation("InitiatorFriendships", fields: [userId], references: [id])
}
model VerificationToken {
identifier String
token String @unique
expires DateTime
@@unique([identifier, token])
}
model Activity {
id String @id @default(cuid())
userId String
name String
description String?
colorCode String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id])
activityLogs ActivityLog[]
}
model ActivityLog {
id String @id @default(cuid())
activityId String
date DateTime @default(now())
count Int @default(1)
activity Activity @relation(fields: [activityId], references: [id])
}
model GlobalProblem {
id String @id @default(cuid())
userId String
name String @unique
description String? @unique
content String?
featuredImage String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
averageAllocation Float?
embedding Unsupported("vector")?
user User @relation(fields: [userId], references: [id])
thatGlobalProblemAllocations GlobalProblemPairAllocation[] @relation("ThatGlobalProblemRelation")
thisGlobalProblemAllocations GlobalProblemPairAllocation[] @relation("ThisGlobalProblemRelation")
globalProblemSolutions GlobalProblemSolution[] @relation("GlobalProblemToSolution")
globalProblemSolutionsPairAllocations GlobalProblemSolutionPairAllocation[]
organizations OrganizationGlobalProblem[]
people PersonGlobalProblem[]
}
model GlobalProblemPairAllocation {
id String @id @default(cuid())
userId String
thisGlobalProblemId String
thatGlobalProblemId String
thisGlobalProblemPercentage Float
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
thatGlobalProblem GlobalProblem @relation("ThatGlobalProblemRelation", fields: [thatGlobalProblemId], references: [id])
thisGlobalProblem GlobalProblem @relation("ThisGlobalProblemRelation", fields: [thisGlobalProblemId], references: [id])
user User @relation(fields: [userId], references: [id])
@@unique([userId, thisGlobalProblemId, thatGlobalProblemId])
}
model GlobalSolution {
id String @id @default(cuid())
userId String
name String @unique
description String? @unique
content String?
featuredImage String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
averageAllocation Float?
embedding Unsupported("vector")?
globalProblemSolutions GlobalProblemSolution[] @relation("GlobalSolutionToProblem")
user User @relation(fields: [userId], references: [id])
thatGlobalSolutionAllocations GlobalSolutionPairAllocation[] @relation("ThatGlobalSolutionRelation")
thisGlobalSolutionAllocations GlobalSolutionPairAllocation[] @relation("ThisGlobalSolutionRelation")
globalSolutionTasks GlobalSolutionTask[] @relation("GlobalSolutionToTask")
organizations OrganizationGlobalSolution[]
people PersonGlobalSolution[]
}
model GlobalSolutionPairAllocation {
id String @id @default(cuid())
userId String
thisGlobalSolutionId String
thatGlobalSolutionId String
thisGlobalSolutionPercentage Float
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
thatGlobalSolution GlobalSolution @relation("ThatGlobalSolutionRelation", fields: [thatGlobalSolutionId], references: [id])
thisGlobalSolution GlobalSolution @relation("ThisGlobalSolutionRelation", fields: [thisGlobalSolutionId], references: [id])
user User @relation(fields: [userId], references: [id])
@@unique([userId, thisGlobalSolutionId, thatGlobalSolutionId])
}
model GlobalProblemSolution {
id String @id @default(cuid())
globalProblemId String
globalSolutionId String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
content String?
description String? @unique
featuredImage String?
name String @unique
averageAllocation Float?
globalProblem GlobalProblem @relation("GlobalProblemToSolution", fields: [globalProblemId], references: [id])
globalSolution GlobalSolution @relation("GlobalSolutionToProblem", fields: [globalSolutionId], references: [id])
thatGlobalProblemSolutionAllocations GlobalProblemSolutionPairAllocation[] @relation("ThatGlobalProblemSolutionRelation")
thisGlobalProblemSolutionAllocations GlobalProblemSolutionPairAllocation[] @relation("ThisGlobalProblemSolutionRelation")
@@unique([globalProblemId, globalSolutionId])
}
model GlobalProblemSolutionPairAllocation {
id String @id @default(cuid())
userId String
thisGlobalProblemSolutionId String
thatGlobalProblemSolutionId String
thisGlobalProblemSolutionPercentage Float
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
globalProblemId String?
globalProblem GlobalProblem? @relation(fields: [globalProblemId], references: [id])
thatGlobalProblemSolution GlobalProblemSolution @relation("ThatGlobalProblemSolutionRelation", fields: [thatGlobalProblemSolutionId], references: [id])
thisGlobalProblemSolution GlobalProblemSolution @relation("ThisGlobalProblemSolutionRelation", fields: [thisGlobalProblemSolutionId], references: [id])
user User @relation(fields: [userId], references: [id])
@@unique([userId, thisGlobalProblemSolutionId, thatGlobalProblemSolutionId])
}
model GlobalSolutionTask {
id String @id @default(cuid())
globalTaskId String
globalSolutionId String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
globalSolution GlobalSolution @relation("GlobalSolutionToTask", fields: [globalSolutionId], references: [id])
globalTask GlobalTask @relation("GlobalTaskToSolution", fields: [globalTaskId], references: [id])
@@unique([globalTaskId, globalSolutionId])
}
model GlobalTask {
id String @id @default(cuid())
userId String
name String @unique
description String? @unique
content String?
featuredImage String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
priority String?
status TaskStatus @default(NOT_STARTED)
dueDate DateTime?
budget Float?
comments GlobalTaskComment[]
embedding Unsupported("vector")?
creator User @relation(fields: [userId], references: [id])
isAtomic Boolean?
complexity TaskComplexity?
tags String[]
estimatedHours Float?
actualHours Float?
deliverable String?
blockingTasks GlobalTaskDependency[] @relation("BlockingTask")
dependentTasks GlobalTaskDependency[] @relation("DependentTask")
skills GlobalTaskSkill[]
globalSolutionTasks GlobalSolutionTask[] @relation("GlobalTaskToSolution")
parentTasks GlobalTaskRelation[] @relation("ChildTasks")
childTasks GlobalTaskRelation[] @relation("ParentTasks")
userTasks UserTask[]
attachments GlobalTaskAttachment[]
contextUrls GlobalTaskContextUrl[]
}
model GlobalTaskRelation {
id String @id @default(cuid())
parentId String
childId String
parent GlobalTask @relation("ParentTasks", fields: [parentId], references: [id])
child GlobalTask @relation("ChildTasks", fields: [childId], references: [id])
@@unique([parentId, childId])
}
model GlobalTaskAttachment {
id String @id @default(cuid())
taskId String
userId String
fileName String
fileUrl String
createdAt DateTime @default(now())
task GlobalTask @relation(fields: [taskId], references: [id])
user User @relation(fields: [userId], references: [id])
}
model GlobalTaskComment {
id String @id @default(cuid())
taskId String
userId String
content String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
task GlobalTask @relation(fields: [taskId], references: [id])
user User @relation(fields: [userId], references: [id])
}
model GlobalTaskSkill {
id String @id @default(cuid())
globalTaskId String
skillId String
globalTask GlobalTask @relation(fields: [globalTaskId], references: [id])
skill Skill @relation(fields: [skillId], references: [id])
@@unique([globalTaskId, skillId])
}
model GlobalTaskDependency {
id String @id @default(cuid())
blockingTaskId String
dependentTaskId String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
blockingTask GlobalTask @relation("BlockingTask", fields: [blockingTaskId], references: [id])
dependentTask GlobalTask @relation("DependentTask", fields: [dependentTaskId], references: [id])
@@unique([blockingTaskId, dependentTaskId])
}
enum TaskComplexity {
LOW
MEDIUM
HIGH
}
model GlobalTaskContextUrl {
id String @id @default(cuid())
url String @unique
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
globalTask GlobalTask @relation(fields: [globalTaskId], references: [id])
globalTaskId String
}
model UserTask {
id String @id @default(cuid())
userId String
globalTaskId String
role UserTaskRole @default(ASSIGNEE)
status TaskStatus @default(NOT_STARTED)
startDate DateTime?
endDate DateTime?
estimatedHours Float?
actualHours Float?
comments String?
assignedAt DateTime @default(now())
globalTask GlobalTask @relation(fields: [globalTaskId], references: [id])
user User @relation(fields: [userId], references: [id])
UserTaskComment UserTaskComment[]
UserTaskAttachment UserTaskAttachment[]
@@unique([userId, globalTaskId])
}
model UserTaskComment {
id String @id @default(cuid())
userTaskId String
userId String
content String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
userTask UserTask @relation(fields: [userTaskId], references: [id])
user User @relation(fields: [userId], references: [id])
}
model UserTaskAttachment {
id String @id @default(cuid())
taskId String
userId String
fileName String
fileUrl String
createdAt DateTime @default(now())
userTask UserTask @relation(fields: [taskId], references: [id])
user User @relation(fields: [userId], references: [id])
}
model WishingWell {
id String @id @default(cuid())
userId String
name String @unique
description String?
content String?
images String[]
featuredImage String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
averageAllocation Float?
embedding Unsupported("vector")?
proposals WishFulfillmentProposal[]
user User @relation(fields: [userId], references: [id])
wishingWellContributions WishingWellContribution[]
thatWishingWellAllocations WishingWellPairAllocation[] @relation("ThatWishingWellRelation")
thisWishingWellAllocations WishingWellPairAllocation[] @relation("ThisWishingWellRelation")
}
model WishingWellPairAllocation {
id String @id @default(cuid())
userId String
thisWishingWellId String
thatWishingWellId String
thisWishingWellPercentage Float
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
thatWishingWell WishingWell @relation("ThatWishingWellRelation", fields: [thatWishingWellId], references: [id])
thisWishingWell WishingWell @relation("ThisWishingWellRelation", fields: [thisWishingWellId], references: [id])
user User @relation(fields: [userId], references: [id])
@@unique([userId, thisWishingWellId, thatWishingWellId])
}
model WishingWellContribution {
id String @id @default(cuid())
wishingWellId String
date DateTime @default(now())
count Int @default(1)
wishingWell WishingWell @relation(fields: [wishingWellId], references: [id])
}
model GenieDAO {
id String @id @default(cuid())
name String
reputation Float @default(0)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
creatorId String
embedding Unsupported("vector")?
creator User @relation("CreatedGenieDAOs", fields: [creatorId], references: [id])
feedback GenieDAOFeedback[]
proposals WishFulfillmentProposal[]
members User[] @relation("JoinedGenieDAOs")
collaborations WishFulfillmentProposal[] @relation("ProposalCollaborators")
}
model WishFulfillmentProposal {
id String @id @default(cuid())
wishingWellId String
genieDAOId String
description String
leadIndicator String
lagIndicator String
wishTokens Int
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
creatorId String
reports ProposalProgressReport[]
creator User @relation("CreatedProposals", fields: [creatorId], references: [id])
genieDAO GenieDAO @relation(fields: [genieDAOId], references: [id])
wishingWell WishingWell @relation(fields: [wishingWellId], references: [id])
collaborators GenieDAO[] @relation("ProposalCollaborators")
}
model ProposalProgressReport {
id String @id @default(cuid())
proposalId String
content String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
creatorId String
creator User @relation(fields: [creatorId], references: [id])
proposal WishFulfillmentProposal @relation(fields: [proposalId], references: [id])
}
model ProposalComparison {
id String @id @default(cuid())
userId String
thisProposalId String
thatProposalId String
thisProposalPercentage Float
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id])
}
model GenieDAOFeedback {
id String @id @default(cuid())
userId String
genieDAOId String
rating Float
comment String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
genieDAO GenieDAO @relation(fields: [genieDAOId], references: [id])
user User @relation(fields: [userId], references: [id])
}
model ApiKey {
id String @id @default(uuid())
name String
displayApiKey String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
userId String
user User @relation(fields: [userId], references: [id])
@@index([userId], map: "api_user_id")
}
model Agent {
id String @id @default(uuid())
name String
userId String
description String @default("Add a agent description...")
createdAt DateTime @default(now())
avatar String?
initialMessage String? @default("Hello, how can I help you today?")
isActive Boolean @default(false)
llmModel LLMModel? @default(GPT_3_5_TURBO_16K_0613)
metadata Json?
outputSchema String?
prompt String? @default("You are a helpful AI Assistant")
type AgentType @default(SUPERAGENT)
sharingLevel SharingLevel @default(PRIVATE)
updatedAt DateTime @updatedAt
conversationStarters String[] @default(["What can you do?"])
user User @relation(fields: [userId], references: [id])
datasources AgentDatasource[]
llms AgentLLM[]
tools AgentTool[]
workflowSteps WorkflowStep[]
Chat Chat[]
callSchedules CallSchedule[]
@@unique([userId, name])
}
model Datasource {
id String @id @default(uuid())
name String
content String?
description String?
url String? @unique
type DatasourceType
userId String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
metadata String?
status DatasourceStatus @default(QUEUED)
vectorDbId String?
datasources AgentDatasource[]
user User @relation(fields: [userId], references: [id])
vectorDb VectorDb? @relation(fields: [vectorDbId], references: [id])
@@unique([name, userId])
}
model AgentDatasource {
agentId String
datasourceId String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
agent Agent @relation(fields: [agentId], references: [id], onDelete: Cascade)
datasource Datasource @relation(fields: [datasourceId], references: [id], onDelete: Cascade)
@@id([agentId, datasourceId])
}
model Tool {
id String @id @default(uuid())
name String
description String
type ToolType
returnDirect Boolean @default(false)
metadata String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
userId String
toolConfig Json?
tools AgentTool[]
user User @relation(fields: [userId], references: [id])
}
model AgentTool {
agentId String
toolId String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
agent Agent @relation(fields: [agentId], references: [id], onDelete: Cascade)
tool Tool @relation(fields: [toolId], references: [id], onDelete: Cascade)
@@id([agentId, toolId])
}
model LLM {
id String @id @default(uuid())
provider LLMProvider @default(OPENAI)
apiKey String
options Json?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
userId String
agents AgentLLM[]
user User @relation(fields: [userId], references: [id])
}
model AgentLLM {
agentId String
llmId String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
agent Agent @relation(fields: [agentId], references: [id], onDelete: Cascade)
llm LLM @relation(fields: [llmId], references: [id])
@@id([agentId, llmId])
}
model Workflow {
id String @id @default(uuid())
name String
description String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
userId String
user User @relation(fields: [userId], references: [id])
workflowConfigs WorkflowConfig[]
steps WorkflowStep[]
}
model WorkflowConfig {
id String @id @default(uuid())
config Json
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
workflowId String
userId String?
User User? @relation(fields: [userId], references: [id])
workflow Workflow @relation(fields: [workflowId], references: [id], onDelete: Cascade)
}
model WorkflowStep {
id String @id @default(uuid())
order Int
workflowId String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
input String?
output String?
agentId String
agent Agent @relation(fields: [agentId], references: [id], onDelete: Cascade)
workflow Workflow @relation(fields: [workflowId], references: [id], onDelete: Cascade)
}
model VectorDb {
id String @id @default(uuid())
provider VectorDbProvider @default(PINECONE)
options Json
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
userId String
datasources Datasource[]
user User @relation(fields: [userId], references: [id])
}
model GithubUser {
name String?
email String?
url String
bio String?
location String?
company String?
followers Int
avatar_url String
blog String?
events_url String
followers_url String
following Int
following_url String
generalDeveloperScore Float?
gists_url String
gravatar_id String?
hireable Boolean?
html_url String
login String
node_id String
organizations_url String
public_gists Int
public_repos Int
received_events_url String
repos_url String
site_admin Boolean
starred_url String
subscriptions_url String
twitter_username String?
type String
id Int @id
created_at String
updated_at String
githubIssuesCreated GithubIssue[]
githubRepos GithubRepo[]
repoDeveloperScores RepoContributorScore[]
}
model GithubIssue {
title String
url String
number Int
comments_url String
events_url String
githubUserId Int
html_url String
labels_url String
node_id String
repository_url String
id Int @id
creator GithubUser @relation(fields: [githubUserId], references: [id])
}
model GithubRepo {
id Int @id
node_id String
name String
full_name String
private Boolean
githubUserId Int
owner GithubUser @relation(fields: [githubUserId], references: [id])
}
model RepoContributorScore {
id Int @id @default(autoincrement())
githubUserId Int
repoOwner String
repoName String
score Float
commitsCount Int
issuesCreatedCount Int
issueCommentsCount Int
commentReactionsScore Float
mergedPullRequestsCount Int
totalPullRequestsCount Int
githubUser GithubUser @relation(fields: [githubUserId], references: [id])
@@unique([githubUserId, repoOwner, repoName])
}
model Library {
id String @id @default(cuid())
name String
version String
type String
description String?
keywords String[]
author String
repository String
githubUrl String?
tags String[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}