@creator.co/creatorco-prisma-client 1.0.35 → 1.0.36-alpha-953b543
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 +12 -10
- package/index-browser.js +6 -4
- package/index.d.ts +4219 -761
- package/index.js +12 -10
- package/libquery_engine-darwin-arm64.dylib.node +0 -0
- package/libquery_engine-darwin.dylib.node +0 -0
- package/libquery_engine-debian-openssl-3.0.x.so.node +0 -0
- package/libquery_engine-linux-arm64-openssl-1.0.x.so.node +0 -0
- package/libquery_engine-linux-arm64-openssl-3.0.x.so.node +0 -0
- package/libquery_engine-linux-musl-arm64-openssl-3.0.x.so.node +0 -0
- package/package.json +1 -1
- package/query_engine-windows.dll.node +0 -0
- package/runtime/edge-esm.js +9 -9
- package/runtime/edge.js +9 -9
- package/runtime/index-browser.d.ts +1 -1
- package/runtime/library.d.ts +10 -6
- package/runtime/library.js +22 -22
- package/runtime/react-native.js +11 -11
- package/runtime/wasm.js +19 -19
- package/schema.prisma +182 -183
- package/wasm.js +6 -4
package/schema.prisma
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
generator erd {
|
|
2
2
|
provider = "prisma-erd-generator"
|
|
3
3
|
includeRelationFromFields = true
|
|
4
|
-
output
|
|
4
|
+
output = "../../docs/creatorco_erd.md"
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
generator kysely {
|
|
@@ -28,24 +28,24 @@ datasource db {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
model User {
|
|
31
|
-
id
|
|
32
|
-
role
|
|
33
|
-
email
|
|
34
|
-
password
|
|
35
|
-
registered
|
|
36
|
-
lastLoginDate
|
|
37
|
-
firstName
|
|
38
|
-
lastName
|
|
39
|
-
phone
|
|
40
|
-
phoneCode
|
|
41
|
-
phoneShort
|
|
42
|
-
profilePicUrl
|
|
43
|
-
forgotPasswordKey
|
|
44
|
-
affiliateSlug
|
|
45
|
-
closed
|
|
46
|
-
closedReason
|
|
47
|
-
usercomLastSynced
|
|
48
|
-
extraData
|
|
31
|
+
id Int @id @default(autoincrement())
|
|
32
|
+
role String
|
|
33
|
+
email String? @unique
|
|
34
|
+
password String?
|
|
35
|
+
registered DateTime @default(now())
|
|
36
|
+
lastLoginDate DateTime?
|
|
37
|
+
firstName String?
|
|
38
|
+
lastName String?
|
|
39
|
+
phone String?
|
|
40
|
+
phoneCode Int?
|
|
41
|
+
phoneShort String?
|
|
42
|
+
profilePicUrl String? @db.VarChar(2083)
|
|
43
|
+
forgotPasswordKey String? @unique
|
|
44
|
+
affiliateSlug String? @unique
|
|
45
|
+
closed DateTime?
|
|
46
|
+
closedReason String?
|
|
47
|
+
usercomLastSynced DateTime? @default(now())
|
|
48
|
+
extraData Json @default("{}")
|
|
49
49
|
|
|
50
50
|
referrerId Int?
|
|
51
51
|
|
|
@@ -70,10 +70,10 @@ model User {
|
|
|
70
70
|
socialProfiles SocialProfile[]
|
|
71
71
|
rakutenActivity RakutenActivity[]
|
|
72
72
|
impactRadiusEvents ImpactRadiusEvent[]
|
|
73
|
+
// @@fulltext([firstName, lastName])
|
|
73
74
|
|
|
74
75
|
@@index([phoneCode, phone])
|
|
75
76
|
@@map("user")
|
|
76
|
-
// @@fulltext([firstName, lastName])
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
model Log {
|
|
@@ -124,7 +124,7 @@ model InstagramProfile {
|
|
|
124
124
|
engagement Float?
|
|
125
125
|
lastUpdated DateTime?
|
|
126
126
|
|
|
127
|
-
fullName String?
|
|
127
|
+
fullName String? @db.VarChar(1024)
|
|
128
128
|
isBusiness Boolean?
|
|
129
129
|
isPrivate Boolean?
|
|
130
130
|
isVerified Boolean?
|
|
@@ -294,9 +294,9 @@ model TwitterProfile {
|
|
|
294
294
|
}
|
|
295
295
|
|
|
296
296
|
model BrandUserProfile {
|
|
297
|
-
id
|
|
298
|
-
userId
|
|
299
|
-
brandId
|
|
297
|
+
id Int @id @default(autoincrement())
|
|
298
|
+
userId Int
|
|
299
|
+
brandId Int
|
|
300
300
|
agencyPrivileges Boolean @default(false) @map("agency_privileges")
|
|
301
301
|
|
|
302
302
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
@@ -304,7 +304,6 @@ model BrandUserProfile {
|
|
|
304
304
|
|
|
305
305
|
@@index([userId])
|
|
306
306
|
@@index([brandId])
|
|
307
|
-
|
|
308
307
|
@@map("branduserprofile")
|
|
309
308
|
}
|
|
310
309
|
|
|
@@ -321,8 +320,8 @@ model Brand {
|
|
|
321
320
|
affiliateCommission Float?
|
|
322
321
|
extraData Json @default("{}")
|
|
323
322
|
|
|
324
|
-
specialistId
|
|
325
|
-
dedicatedSpecialist
|
|
323
|
+
specialistId Int?
|
|
324
|
+
dedicatedSpecialist User? @relation(fields: [specialistId], references: [id])
|
|
326
325
|
instagramProfile InstagramProfile?
|
|
327
326
|
youtubeProfile YoutubeProfile?
|
|
328
327
|
tiktokProfile TiktokProfile?
|
|
@@ -347,11 +346,11 @@ model Brand {
|
|
|
347
346
|
productLists ProductList[]
|
|
348
347
|
|
|
349
348
|
// for agencies
|
|
350
|
-
parentBrandId
|
|
351
|
-
parentBrand
|
|
352
|
-
childBrands
|
|
349
|
+
parentBrandId Int?
|
|
350
|
+
parentBrand Brand? @relation("ChildBrands", fields: [parentBrandId], references: [id])
|
|
351
|
+
childBrands Brand[] @relation("ChildBrands")
|
|
353
352
|
// generated (for search)
|
|
354
|
-
searchName
|
|
353
|
+
searchName String? @default(dbgenerated())
|
|
355
354
|
|
|
356
355
|
@@map("brand")
|
|
357
356
|
}
|
|
@@ -393,13 +392,13 @@ model ReportCredits {
|
|
|
393
392
|
}
|
|
394
393
|
|
|
395
394
|
model BrandToImage {
|
|
396
|
-
id
|
|
397
|
-
brandId
|
|
398
|
-
type
|
|
395
|
+
id Int @id @default(autoincrement())
|
|
396
|
+
brandId Int
|
|
397
|
+
type String
|
|
399
398
|
|
|
400
|
-
brand
|
|
399
|
+
brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
401
400
|
|
|
402
|
-
sizes
|
|
401
|
+
sizes BrandImage[]
|
|
403
402
|
|
|
404
403
|
@@index([brandId])
|
|
405
404
|
@@map("brandtoimage")
|
|
@@ -513,16 +512,16 @@ model Campaign {
|
|
|
513
512
|
affiliateLinkPath String?
|
|
514
513
|
metaData Json @default("{}")
|
|
515
514
|
|
|
516
|
-
steps
|
|
517
|
-
categories
|
|
518
|
-
optIns
|
|
519
|
-
images
|
|
520
|
-
variables
|
|
521
|
-
productLists
|
|
522
|
-
countries
|
|
523
|
-
campaignPins
|
|
524
|
-
socialPosts
|
|
525
|
-
campaignInvites
|
|
515
|
+
steps CampaignStep[]
|
|
516
|
+
categories CampaignToCategory[]
|
|
517
|
+
optIns OptIn[]
|
|
518
|
+
images CampaignToImage[]
|
|
519
|
+
variables Variable[]
|
|
520
|
+
productLists CampaignToProductList[]
|
|
521
|
+
countries CampaignToCountry[]
|
|
522
|
+
campaignPins CampaignPin[]
|
|
523
|
+
socialPosts SocialPost[]
|
|
524
|
+
campaignInvites CampaignInvite[]
|
|
526
525
|
campaignToShopifyProducts CampaignToShopifyProduct[]
|
|
527
526
|
|
|
528
527
|
brandId Int
|
|
@@ -547,7 +546,6 @@ model CampaignPin {
|
|
|
547
546
|
campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)
|
|
548
547
|
|
|
549
548
|
@@index([userId])
|
|
550
|
-
|
|
551
549
|
@@map("campaignpin")
|
|
552
550
|
}
|
|
553
551
|
|
|
@@ -586,16 +584,17 @@ model CampaignToCountry {
|
|
|
586
584
|
}
|
|
587
585
|
|
|
588
586
|
model ProductList {
|
|
589
|
-
id Int
|
|
587
|
+
id Int @id @default(autoincrement())
|
|
590
588
|
title String
|
|
591
|
-
description String?
|
|
592
|
-
metaData Json
|
|
589
|
+
description String? @db.Text
|
|
590
|
+
metaData Json @default("{}")
|
|
591
|
+
deactivated DateTime?
|
|
593
592
|
|
|
594
593
|
brandId Int
|
|
595
594
|
|
|
596
595
|
brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
597
596
|
|
|
598
|
-
items
|
|
597
|
+
items ProductListItem[]
|
|
599
598
|
campaignProductLists CampaignToProductList[]
|
|
600
599
|
|
|
601
600
|
@@index([brandId])
|
|
@@ -603,24 +602,25 @@ model ProductList {
|
|
|
603
602
|
}
|
|
604
603
|
|
|
605
604
|
model ProductListItem {
|
|
606
|
-
id Int
|
|
605
|
+
id Int @id @default(autoincrement())
|
|
607
606
|
title String
|
|
608
|
-
description String?
|
|
609
|
-
metaData Json
|
|
607
|
+
description String? @db.Text
|
|
608
|
+
metaData Json @default("{}")
|
|
609
|
+
deactivated DateTime?
|
|
610
610
|
|
|
611
611
|
productListId Int
|
|
612
|
-
productList
|
|
613
|
-
optins
|
|
612
|
+
productList ProductList @relation(fields: [productListId], references: [id], onDelete: Cascade)
|
|
613
|
+
optins OptinToProductListItem[]
|
|
614
614
|
|
|
615
615
|
@@index([productListId])
|
|
616
616
|
@@map("product_list_item")
|
|
617
617
|
}
|
|
618
618
|
|
|
619
619
|
model CampaignToProductList {
|
|
620
|
-
campaignId
|
|
620
|
+
campaignId Int
|
|
621
621
|
productListId Int
|
|
622
622
|
|
|
623
|
-
campaign
|
|
623
|
+
campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)
|
|
624
624
|
productList ProductList @relation(fields: [productListId], references: [id])
|
|
625
625
|
|
|
626
626
|
@@id([campaignId, productListId])
|
|
@@ -629,10 +629,10 @@ model CampaignToProductList {
|
|
|
629
629
|
}
|
|
630
630
|
|
|
631
631
|
model OptinToProductListItem {
|
|
632
|
-
optInId
|
|
632
|
+
optInId Int
|
|
633
633
|
productListItemId Int
|
|
634
634
|
|
|
635
|
-
optIn
|
|
635
|
+
optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)
|
|
636
636
|
productListItem ProductListItem @relation(fields: [productListItemId], references: [id], onDelete: Cascade)
|
|
637
637
|
|
|
638
638
|
@@id([optInId, productListItemId])
|
|
@@ -680,16 +680,16 @@ model Step {
|
|
|
680
680
|
}
|
|
681
681
|
|
|
682
682
|
model CampaignStep {
|
|
683
|
-
id
|
|
684
|
-
placement
|
|
685
|
-
stepSettings
|
|
686
|
-
actionee
|
|
687
|
-
instructions
|
|
688
|
-
customStepTitle
|
|
689
|
-
customForm
|
|
690
|
-
metaData
|
|
691
|
-
campaignId
|
|
692
|
-
stepId
|
|
683
|
+
id Int @id @default(autoincrement())
|
|
684
|
+
placement Int
|
|
685
|
+
stepSettings Json?
|
|
686
|
+
actionee String?
|
|
687
|
+
instructions String? @db.Text
|
|
688
|
+
customStepTitle String?
|
|
689
|
+
customForm Json?
|
|
690
|
+
metaData Json @default("{}")
|
|
691
|
+
campaignId Int
|
|
692
|
+
stepId Int?
|
|
693
693
|
|
|
694
694
|
campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)
|
|
695
695
|
step Step? @relation(fields: [stepId], references: [id])
|
|
@@ -698,7 +698,6 @@ model CampaignStep {
|
|
|
698
698
|
optInSteps OptInStep[]
|
|
699
699
|
|
|
700
700
|
@@index([campaignId])
|
|
701
|
-
|
|
702
701
|
@@map("campaignstep")
|
|
703
702
|
}
|
|
704
703
|
|
|
@@ -756,12 +755,12 @@ model OptIn {
|
|
|
756
755
|
campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)
|
|
757
756
|
currentStep CampaignStep? @relation(fields: [currentStepId], references: [id])
|
|
758
757
|
|
|
759
|
-
variables
|
|
760
|
-
optInSteps
|
|
761
|
-
chat
|
|
762
|
-
campaignInvites
|
|
763
|
-
trolleyPayments
|
|
764
|
-
affiliateClicks
|
|
758
|
+
variables OptInVariable[]
|
|
759
|
+
optInSteps OptInStep[]
|
|
760
|
+
chat Chat?
|
|
761
|
+
campaignInvites CampaignInvite[]
|
|
762
|
+
trolleyPayments TrolleyPayment[]
|
|
763
|
+
affiliateClicks AffiliateClick[]
|
|
765
764
|
productListItems OptinToProductListItem[]
|
|
766
765
|
|
|
767
766
|
@@index([userId])
|
|
@@ -770,15 +769,15 @@ model OptIn {
|
|
|
770
769
|
}
|
|
771
770
|
|
|
772
771
|
model TrolleyPayment {
|
|
773
|
-
id
|
|
774
|
-
paymentId
|
|
775
|
-
type
|
|
776
|
-
status
|
|
777
|
-
optInId
|
|
778
|
-
paymentAmount
|
|
779
|
-
metaData
|
|
772
|
+
id Int @id @default(autoincrement())
|
|
773
|
+
paymentId String @unique
|
|
774
|
+
type trolleyPaymentType?
|
|
775
|
+
status trolleyPaymentStatus
|
|
776
|
+
optInId Int?
|
|
777
|
+
paymentAmount Int
|
|
778
|
+
metaData Json @default("{}")
|
|
780
779
|
|
|
781
|
-
optIn
|
|
780
|
+
optIn OptIn? @relation(fields: [optInId], references: [id])
|
|
782
781
|
}
|
|
783
782
|
|
|
784
783
|
enum trolleyPaymentType {
|
|
@@ -811,7 +810,7 @@ model OptInVariable {
|
|
|
811
810
|
|
|
812
811
|
model SocialPost {
|
|
813
812
|
id Int @id @default(autoincrement())
|
|
814
|
-
externalId String? @map("external_id")// TODO: This should be required once all of the posts have been updated
|
|
813
|
+
externalId String? @map("external_id") // TODO: This should be required once all of the posts have been updated
|
|
815
814
|
phylloId String? @unique
|
|
816
815
|
metaData Json @default("{}")
|
|
817
816
|
data Json @default("{}") // DEPRECATED, USE metaData instead, seems to be an error when attempting to remove this field, proabably due to table size
|
|
@@ -854,12 +853,10 @@ model SocialPost {
|
|
|
854
853
|
campaign Campaign? @relation(fields: [campaignId], references: [id])
|
|
855
854
|
lists ListToSocialPost[]
|
|
856
855
|
|
|
856
|
+
@@unique([platform, externalId])
|
|
857
857
|
@@index(campaignId)
|
|
858
858
|
@@index(userId)
|
|
859
859
|
@@index(posted)
|
|
860
|
-
|
|
861
|
-
@@unique([platform, externalId])
|
|
862
|
-
|
|
863
860
|
@@map("socialpost")
|
|
864
861
|
}
|
|
865
862
|
|
|
@@ -918,12 +915,12 @@ model Image {
|
|
|
918
915
|
}
|
|
919
916
|
|
|
920
917
|
model BrandImage {
|
|
921
|
-
id
|
|
922
|
-
url
|
|
923
|
-
size
|
|
924
|
-
brandImageId
|
|
918
|
+
id Int @id @default(autoincrement())
|
|
919
|
+
url String @db.VarChar(2083)
|
|
920
|
+
size String
|
|
921
|
+
brandImageId Int
|
|
925
922
|
|
|
926
|
-
brandImage
|
|
923
|
+
brandImage BrandToImage @relation(fields: [brandImageId], references: [id], onDelete: Cascade)
|
|
927
924
|
|
|
928
925
|
@@index([brandImageId])
|
|
929
926
|
@@map("brandimage")
|
|
@@ -1014,7 +1011,7 @@ model AffiliateClick {
|
|
|
1014
1011
|
|
|
1015
1012
|
affiliateLinkId Int
|
|
1016
1013
|
|
|
1017
|
-
optin OptIn
|
|
1014
|
+
optin OptIn @relation(fields: [optInId], references: [id])
|
|
1018
1015
|
affiliateLink AffiliateLink @relation(fields: [affiliateLinkId], references: [id])
|
|
1019
1016
|
affiliateEvent AffiliateEvent[]
|
|
1020
1017
|
}
|
|
@@ -1050,22 +1047,22 @@ model SavedFile {
|
|
|
1050
1047
|
}
|
|
1051
1048
|
|
|
1052
1049
|
model CampaignInvite {
|
|
1053
|
-
id
|
|
1054
|
-
socialProfileId
|
|
1055
|
-
brandId
|
|
1056
|
-
campaignId
|
|
1057
|
-
optInId
|
|
1058
|
-
code
|
|
1059
|
-
createdAt
|
|
1060
|
-
declineDate
|
|
1061
|
-
declineReason
|
|
1062
|
-
|
|
1063
|
-
metaData
|
|
1064
|
-
|
|
1065
|
-
brand
|
|
1066
|
-
campaign
|
|
1067
|
-
socialProfile
|
|
1068
|
-
optIn
|
|
1050
|
+
id Int @id @default(autoincrement())
|
|
1051
|
+
socialProfileId Int?
|
|
1052
|
+
brandId Int
|
|
1053
|
+
campaignId Int?
|
|
1054
|
+
optInId Int? @unique
|
|
1055
|
+
code String? @unique
|
|
1056
|
+
createdAt DateTime @default(now())
|
|
1057
|
+
declineDate DateTime?
|
|
1058
|
+
declineReason String? @db.Text
|
|
1059
|
+
|
|
1060
|
+
metaData Json? @default("{}")
|
|
1061
|
+
|
|
1062
|
+
brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
1063
|
+
campaign Campaign? @relation(fields: [campaignId], references: [id])
|
|
1064
|
+
socialProfile SocialProfile? @relation(fields: [socialProfileId], references: [id])
|
|
1065
|
+
optIn OptIn? @relation(fields: [optInId], references: [id])
|
|
1069
1066
|
|
|
1070
1067
|
@@index([socialProfileId])
|
|
1071
1068
|
}
|
|
@@ -1084,7 +1081,7 @@ model CreatorList {
|
|
|
1084
1081
|
campaign Campaign? @relation(fields: [campaignId], references: [id])
|
|
1085
1082
|
sequences Sequence[]
|
|
1086
1083
|
|
|
1087
|
-
@@index
|
|
1084
|
+
@@index([brandId])
|
|
1088
1085
|
@@map("creatorlist")
|
|
1089
1086
|
}
|
|
1090
1087
|
|
|
@@ -1134,9 +1131,9 @@ model SocialProfile {
|
|
|
1134
1131
|
created DateTime @default(now())
|
|
1135
1132
|
updated DateTime?
|
|
1136
1133
|
|
|
1137
|
-
creatorListItems
|
|
1138
|
-
campaignInvites
|
|
1139
|
-
user
|
|
1134
|
+
creatorListItems CreatorListItem[]
|
|
1135
|
+
campaignInvites CampaignInvite[]
|
|
1136
|
+
user User? @relation(fields: [userId], references: [id])
|
|
1140
1137
|
|
|
1141
1138
|
@@index(username)
|
|
1142
1139
|
@@index(userId)
|
|
@@ -1156,16 +1153,16 @@ model MessageTemplate {
|
|
|
1156
1153
|
}
|
|
1157
1154
|
|
|
1158
1155
|
model EmailTemplate {
|
|
1159
|
-
id
|
|
1160
|
-
label
|
|
1161
|
-
subject
|
|
1162
|
-
template
|
|
1163
|
-
brandId
|
|
1156
|
+
id Int @id @default(autoincrement())
|
|
1157
|
+
label String?
|
|
1158
|
+
subject String?
|
|
1159
|
+
template String @db.Text
|
|
1160
|
+
brandId Int?
|
|
1164
1161
|
|
|
1165
|
-
brand
|
|
1166
|
-
metaData
|
|
1162
|
+
brand Brand? @relation(fields: [brandId], references: [id])
|
|
1163
|
+
metaData Json @default("{}") // to save any additional data such as user defined variables
|
|
1167
1164
|
|
|
1168
|
-
sequenceSteps
|
|
1165
|
+
sequenceSteps SequenceStep[]
|
|
1169
1166
|
|
|
1170
1167
|
@@index([brandId])
|
|
1171
1168
|
}
|
|
@@ -1229,18 +1226,19 @@ model RakutenActivity {
|
|
|
1229
1226
|
|
|
1230
1227
|
@@map("rakutenactivity")
|
|
1231
1228
|
}
|
|
1229
|
+
|
|
1232
1230
|
model ImpactRadiusEvent {
|
|
1233
|
-
id
|
|
1234
|
-
type
|
|
1235
|
-
created
|
|
1236
|
-
amount
|
|
1237
|
-
commission
|
|
1238
|
-
metaData
|
|
1231
|
+
id Int @id @default(autoincrement())
|
|
1232
|
+
type String // action/click
|
|
1233
|
+
created DateTime @default(now())
|
|
1234
|
+
amount Float?
|
|
1235
|
+
commission Float?
|
|
1236
|
+
metaData Json @default("{}")
|
|
1239
1237
|
|
|
1240
|
-
userId
|
|
1238
|
+
userId Int
|
|
1241
1239
|
brandId Int?
|
|
1242
1240
|
|
|
1243
|
-
user
|
|
1241
|
+
user User @relation(fields: [userId], references: [id])
|
|
1244
1242
|
brand Brand? @relation(fields: [brandId], references: [id])
|
|
1245
1243
|
}
|
|
1246
1244
|
|
|
@@ -1251,28 +1249,29 @@ model CreatorSearchFilter {
|
|
|
1251
1249
|
filters Json @default("{}")
|
|
1252
1250
|
createdAt DateTime @default(now())
|
|
1253
1251
|
updatedAt DateTime?
|
|
1254
|
-
brand Brand
|
|
1252
|
+
brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
1253
|
+
|
|
1255
1254
|
@@map("creatorsearchfilter")
|
|
1256
1255
|
}
|
|
1257
1256
|
|
|
1258
1257
|
model Sequence {
|
|
1259
|
-
id
|
|
1260
|
-
campaignId
|
|
1261
|
-
creatorListId
|
|
1262
|
-
title
|
|
1263
|
-
createdAt
|
|
1264
|
-
completed
|
|
1265
|
-
brandId
|
|
1266
|
-
enabled
|
|
1267
|
-
|
|
1268
|
-
campaign
|
|
1269
|
-
creatorList
|
|
1270
|
-
brand
|
|
1271
|
-
|
|
1272
|
-
steps
|
|
1273
|
-
outboundEmails
|
|
1274
|
-
inboundEmails
|
|
1275
|
-
imapCheckpoints
|
|
1258
|
+
id Int @id @default(autoincrement())
|
|
1259
|
+
campaignId Int
|
|
1260
|
+
creatorListId Int
|
|
1261
|
+
title String @db.VarChar(255)
|
|
1262
|
+
createdAt DateTime @default(now())
|
|
1263
|
+
completed Boolean @default(false)
|
|
1264
|
+
brandId Int
|
|
1265
|
+
enabled Boolean @default(false)
|
|
1266
|
+
|
|
1267
|
+
campaign Campaign @relation(fields: [campaignId], references: [id])
|
|
1268
|
+
creatorList CreatorList @relation(fields: [creatorListId], references: [id])
|
|
1269
|
+
brand Brand @relation(fields: [brandId], references: [id])
|
|
1270
|
+
|
|
1271
|
+
steps SequenceStep[]
|
|
1272
|
+
outboundEmails SequenceOutboundEmail[]
|
|
1273
|
+
inboundEmails SequenceInboundEmail[]
|
|
1274
|
+
imapCheckpoints SequenceImapCheckpoint[]
|
|
1276
1275
|
|
|
1277
1276
|
@@map("sequence")
|
|
1278
1277
|
}
|
|
@@ -1286,10 +1285,10 @@ model SequenceStep {
|
|
|
1286
1285
|
order Int
|
|
1287
1286
|
stepId Int
|
|
1288
1287
|
|
|
1289
|
-
sequence
|
|
1290
|
-
emailTemplate
|
|
1288
|
+
sequence Sequence @relation(fields: [sequenceId], references: [id], onDelete: Cascade)
|
|
1289
|
+
emailTemplate EmailTemplate @relation(fields: [emailTemplateId], references: [id])
|
|
1291
1290
|
|
|
1292
|
-
outboundEmails
|
|
1291
|
+
outboundEmails SequenceOutboundEmail[]
|
|
1293
1292
|
|
|
1294
1293
|
@@map("sequencestep")
|
|
1295
1294
|
}
|
|
@@ -1301,9 +1300,9 @@ model SequenceOutboundEmail {
|
|
|
1301
1300
|
sequenceStepId Int
|
|
1302
1301
|
sentAt DateTime @default(now())
|
|
1303
1302
|
|
|
1304
|
-
sequence
|
|
1305
|
-
creatorList
|
|
1306
|
-
sequenceStep
|
|
1303
|
+
sequence Sequence @relation(fields: [sequenceId], references: [id])
|
|
1304
|
+
creatorList CreatorListItem @relation(fields: [creatorListItemId], references: [id])
|
|
1305
|
+
sequenceStep SequenceStep @relation(fields: [sequenceStepId], references: [id])
|
|
1307
1306
|
|
|
1308
1307
|
@@map("sequenceoutboundemail")
|
|
1309
1308
|
}
|
|
@@ -1315,7 +1314,7 @@ model SequenceInboundEmail {
|
|
|
1315
1314
|
receivedAt DateTime @default(now())
|
|
1316
1315
|
msgHash String
|
|
1317
1316
|
|
|
1318
|
-
sequence Sequence
|
|
1317
|
+
sequence Sequence @relation(fields: [sequenceId], references: [id])
|
|
1319
1318
|
creatorListId CreatorListItem @relation(fields: [creatorListItemId], references: [id])
|
|
1320
1319
|
|
|
1321
1320
|
@@map("sequenceinboundemail")
|
|
@@ -1328,7 +1327,7 @@ model SequenceImapCheckpoint {
|
|
|
1328
1327
|
createdAt DateTime @default(now())
|
|
1329
1328
|
updatedAt DateTime @default(now())
|
|
1330
1329
|
|
|
1331
|
-
sequence Sequence
|
|
1330
|
+
sequence Sequence @relation(fields: [sequenceId], references: [id])
|
|
1332
1331
|
creatorListId CreatorListItem @relation(fields: [creatorListItemId], references: [id])
|
|
1333
1332
|
|
|
1334
1333
|
@@id([sequenceId, creatorListItemId])
|
|
@@ -1336,19 +1335,19 @@ model SequenceImapCheckpoint {
|
|
|
1336
1335
|
}
|
|
1337
1336
|
|
|
1338
1337
|
model ShopifyStore {
|
|
1339
|
-
id Int
|
|
1338
|
+
id Int @id @default(autoincrement())
|
|
1340
1339
|
name String?
|
|
1341
1340
|
url String
|
|
1342
|
-
accessToken String?
|
|
1341
|
+
accessToken String? @map("access_token")
|
|
1343
1342
|
syncStatus ShopifyStoreSyncStatus @default(syncing) @map("sync_status")
|
|
1344
|
-
lastSynced DateTime?
|
|
1345
|
-
metaData Json
|
|
1343
|
+
lastSynced DateTime? @map("last_synced")
|
|
1344
|
+
metaData Json @default("{}") @map("meta_data")
|
|
1346
1345
|
|
|
1347
|
-
brandId
|
|
1346
|
+
brandId Int @map("brand_id")
|
|
1348
1347
|
|
|
1349
|
-
products
|
|
1348
|
+
products ShopifyProduct[]
|
|
1350
1349
|
|
|
1351
|
-
brand
|
|
1350
|
+
brand Brand? @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
1352
1351
|
|
|
1353
1352
|
@@index([brandId])
|
|
1354
1353
|
@@map("shopify_store")
|
|
@@ -1361,18 +1360,18 @@ enum ShopifyStoreSyncStatus {
|
|
|
1361
1360
|
}
|
|
1362
1361
|
|
|
1363
1362
|
model ShopifyProduct {
|
|
1364
|
-
id
|
|
1365
|
-
shopifyId
|
|
1366
|
-
title
|
|
1367
|
-
handle
|
|
1368
|
-
imageUrl
|
|
1363
|
+
id Int @id @default(autoincrement())
|
|
1364
|
+
shopifyId String @unique @map("shopify_id")
|
|
1365
|
+
title String
|
|
1366
|
+
handle String
|
|
1367
|
+
imageUrl String @map("image_url") @db.Text
|
|
1369
1368
|
|
|
1370
|
-
metaData
|
|
1369
|
+
metaData Json @default("{}") @map("meta_data")
|
|
1371
1370
|
|
|
1372
|
-
shopifyStoreId Int
|
|
1371
|
+
shopifyStoreId Int @map("shopify_store_id")
|
|
1373
1372
|
|
|
1374
|
-
campaignToShopifyProducts
|
|
1375
|
-
variations
|
|
1373
|
+
campaignToShopifyProducts CampaignToShopifyProduct[]
|
|
1374
|
+
variations ShopifyProductVariation[]
|
|
1376
1375
|
|
|
1377
1376
|
shopifyStore ShopifyStore @relation(fields: [shopifyStoreId], references: [id], onDelete: Cascade)
|
|
1378
1377
|
|
|
@@ -1380,14 +1379,14 @@ model ShopifyProduct {
|
|
|
1380
1379
|
}
|
|
1381
1380
|
|
|
1382
1381
|
model ShopifyProductVariation {
|
|
1383
|
-
id
|
|
1384
|
-
shopifyId
|
|
1385
|
-
title
|
|
1386
|
-
imageUrl
|
|
1382
|
+
id Int @id @default(autoincrement())
|
|
1383
|
+
shopifyId String @unique @map("shopify_id")
|
|
1384
|
+
title String
|
|
1385
|
+
imageUrl String @map("image_url") @db.Text
|
|
1387
1386
|
|
|
1388
|
-
metaData
|
|
1387
|
+
metaData Json @default("{}") @map("meta_data")
|
|
1389
1388
|
|
|
1390
|
-
shopifyProductId Int
|
|
1389
|
+
shopifyProductId Int @map("shopify_product_id")
|
|
1391
1390
|
|
|
1392
1391
|
shopifyProduct ShopifyProduct @relation(fields: [shopifyProductId], references: [id], onDelete: Cascade)
|
|
1393
1392
|
|
|
@@ -1395,11 +1394,11 @@ model ShopifyProductVariation {
|
|
|
1395
1394
|
}
|
|
1396
1395
|
|
|
1397
1396
|
model CampaignToShopifyProduct {
|
|
1398
|
-
campaignId
|
|
1399
|
-
shopifyProductId
|
|
1397
|
+
campaignId Int @map("campaign_id")
|
|
1398
|
+
shopifyProductId Int @map("shopify_product_id")
|
|
1400
1399
|
|
|
1401
|
-
campaign
|
|
1402
|
-
shopifyProduct
|
|
1400
|
+
campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)
|
|
1401
|
+
shopifyProduct ShopifyProduct @relation(fields: [shopifyProductId], references: [id], onDelete: Cascade)
|
|
1403
1402
|
|
|
1404
1403
|
@@id([campaignId, shopifyProductId])
|
|
1405
1404
|
@@map("campaign_to_shopify_product")
|