@creator.co/creatorco-prisma-client 1.0.15 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/edge.js +4 -5
- package/index-browser.js +0 -1
- package/index.d.ts +0 -48
- package/index.js +4 -5
- package/package.json +1 -1
- package/schema.prisma +19 -10
package/package.json
CHANGED
package/schema.prisma
CHANGED
|
@@ -32,7 +32,7 @@ model User {
|
|
|
32
32
|
email String? @unique
|
|
33
33
|
password String?
|
|
34
34
|
registered DateTime @default(now())
|
|
35
|
-
lastLoginDate DateTime?
|
|
35
|
+
lastLoginDate DateTime?
|
|
36
36
|
firstName String?
|
|
37
37
|
lastName String?
|
|
38
38
|
phone String?
|
|
@@ -338,11 +338,11 @@ model Brand {
|
|
|
338
338
|
sequences Sequence[]
|
|
339
339
|
impactRadiusEvents ImpactRadiusEvent[]
|
|
340
340
|
|
|
341
|
-
|
|
341
|
+
// for agencies
|
|
342
342
|
parentBrandId Int?
|
|
343
343
|
parentBrand Brand? @relation("ChildBrands", fields: [parentBrandId], references: [id])
|
|
344
344
|
childBrands Brand[] @relation("ChildBrands")
|
|
345
|
-
|
|
345
|
+
// generated (for search)
|
|
346
346
|
searchName String? @default(dbgenerated())
|
|
347
347
|
|
|
348
348
|
@@map("brand")
|
|
@@ -446,6 +446,7 @@ model Message {
|
|
|
446
446
|
user User? @relation(fields: [userId], references: [id])
|
|
447
447
|
chat Chat @relation(fields: [chatId], references: [id], onDelete: Cascade)
|
|
448
448
|
|
|
449
|
+
@@index([chatId])
|
|
449
450
|
@@map("message")
|
|
450
451
|
}
|
|
451
452
|
|
|
@@ -640,6 +641,7 @@ model OptInStep {
|
|
|
640
641
|
optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)
|
|
641
642
|
campaignStep CampaignStep @relation(fields: [campaignStepId], references: [id], onDelete: Cascade)
|
|
642
643
|
|
|
644
|
+
@@index([campaignStepId])
|
|
643
645
|
@@map("optinstep")
|
|
644
646
|
}
|
|
645
647
|
|
|
@@ -684,6 +686,8 @@ model OptIn {
|
|
|
684
686
|
chat Chat?
|
|
685
687
|
campaignInvites CampaignInvite[]
|
|
686
688
|
|
|
689
|
+
@@index([userId])
|
|
690
|
+
@@index([campaignId])
|
|
687
691
|
@@map("optin")
|
|
688
692
|
}
|
|
689
693
|
|
|
@@ -706,7 +710,6 @@ model SocialPost {
|
|
|
706
710
|
data Json @default("{}") // DEPRECATED, USE metaData instead, seems to be an error when attempting to remove this field, proabably due to table size
|
|
707
711
|
lastFetched DateTime?
|
|
708
712
|
lastWebhook DateTime?
|
|
709
|
-
isStale Boolean? // TODO: this field is here because prisma doesn't support comparing one column to another, ideally we could just check if lastFetched > lastWebhook but for now we need to control/check this field
|
|
710
713
|
|
|
711
714
|
// BASIC INFO
|
|
712
715
|
posted DateTime?
|
|
@@ -746,7 +749,10 @@ model SocialPost {
|
|
|
746
749
|
|
|
747
750
|
socialPostTags SocialPostTag[]
|
|
748
751
|
|
|
749
|
-
@@index(
|
|
752
|
+
@@index(campaignId)
|
|
753
|
+
@@index(userId)
|
|
754
|
+
@@index(posted)
|
|
755
|
+
|
|
750
756
|
@@map("socialpost")
|
|
751
757
|
}
|
|
752
758
|
|
|
@@ -898,7 +904,7 @@ model SavedFile {
|
|
|
898
904
|
|
|
899
905
|
model CampaignInvite {
|
|
900
906
|
id Int @default(autoincrement()) @id
|
|
901
|
-
socialProfileId Int?
|
|
907
|
+
socialProfileId Int?
|
|
902
908
|
brandId Int
|
|
903
909
|
campaignId Int?
|
|
904
910
|
optInId Int? @unique
|
|
@@ -906,14 +912,14 @@ model CampaignInvite {
|
|
|
906
912
|
createdAt DateTime @default(now())
|
|
907
913
|
declineDate DateTime?
|
|
908
914
|
declineReason String? @db.Text
|
|
909
|
-
|
|
915
|
+
|
|
910
916
|
metaData Json? @default("{}")
|
|
911
917
|
|
|
912
918
|
brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
913
919
|
campaign Campaign? @relation(fields: [campaignId], references: [id])
|
|
914
920
|
socialProfile SocialProfile? @relation(fields: [socialProfileId], references: [id])
|
|
915
921
|
optIn OptIn? @relation(fields: [optInId], references: [id])
|
|
916
|
-
|
|
922
|
+
|
|
917
923
|
}
|
|
918
924
|
|
|
919
925
|
model CreatorList {
|
|
@@ -947,11 +953,12 @@ model CreatorListItem {
|
|
|
947
953
|
|
|
948
954
|
creatorList CreatorList @relation(fields: [creatorListId], references: [id], onDelete: Cascade)
|
|
949
955
|
socialProfile SocialProfile? @relation(fields: [socialProfileId], references: [id], onDelete: Cascade)
|
|
950
|
-
|
|
956
|
+
|
|
951
957
|
sequenceOutboundEmails SequenceOutboundEmail[]
|
|
952
958
|
sequenceInboundEmails SequenceInboundEmail[]
|
|
953
959
|
sequenceImapCheckpoints SequenceImapCheckpoint[]
|
|
954
960
|
|
|
961
|
+
@@index([creatorListId])
|
|
955
962
|
@@map("creatorlistitem")
|
|
956
963
|
}
|
|
957
964
|
|
|
@@ -982,6 +989,7 @@ model SocialProfile {
|
|
|
982
989
|
user User? @relation(fields: [userId], references: [id])
|
|
983
990
|
|
|
984
991
|
@@index(username)
|
|
992
|
+
@@index(userId)
|
|
985
993
|
@@map("socialprofile")
|
|
986
994
|
}
|
|
987
995
|
|
|
@@ -1002,7 +1010,7 @@ model EmailTemplate {
|
|
|
1002
1010
|
subject String?
|
|
1003
1011
|
template String @db.Text
|
|
1004
1012
|
brandId Int?
|
|
1005
|
-
|
|
1013
|
+
|
|
1006
1014
|
brand Brand? @relation(fields: [brandId], references: [id])
|
|
1007
1015
|
metaData Json @default("{}") // to save any additional data such as user defined variables
|
|
1008
1016
|
|
|
@@ -1035,6 +1043,7 @@ model ListToSocialPost {
|
|
|
1035
1043
|
list SocialListeningList @relation(fields: [listId], references: [id], onDelete: Cascade)
|
|
1036
1044
|
socialPost SocialPost @relation(fields: [postId], references: [id], onDelete: Cascade)
|
|
1037
1045
|
|
|
1046
|
+
@@index([listId, postId])
|
|
1038
1047
|
@@map("listtosocialpost")
|
|
1039
1048
|
}
|
|
1040
1049
|
|