@creator.co/creatorco-prisma-client 1.0.34 → 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/schema.prisma CHANGED
@@ -1,7 +1,7 @@
1
1
  generator erd {
2
2
  provider = "prisma-erd-generator"
3
3
  includeRelationFromFields = true
4
- output = "../../docs/creatorco_erd.md"
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 Int @default(autoincrement()) @id
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("{}")
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? @db.VarChar(1024)
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 Int @id @default(autoincrement())
298
- userId Int
299
- brandId Int
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 Int?
325
- dedicatedSpecialist User? @relation(fields: [specialistId], references: [id])
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 Int?
351
- parentBrand Brand? @relation("ChildBrands", fields: [parentBrandId], references: [id])
352
- childBrands Brand[] @relation("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 String? @default(dbgenerated())
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 Int @default(autoincrement()) @id
397
- brandId Int
398
- type String
395
+ id Int @id @default(autoincrement())
396
+ brandId Int
397
+ type String
399
398
 
400
- brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
399
+ brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
401
400
 
402
- sizes BrandImage[]
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 CampaignStep[]
517
- categories CampaignToCategory[]
518
- optIns OptIn[]
519
- images CampaignToImage[]
520
- variables Variable[]
521
- productLists CampaignToProductList[]
522
- countries CampaignToCountry[]
523
- campaignPins CampaignPin[]
524
- socialPosts SocialPost[]
525
- campaignInvites CampaignInvite[]
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 @id @default(autoincrement())
587
+ id Int @id @default(autoincrement())
590
588
  title String
591
- description String? @db.Text
592
- metaData Json @default("{}")
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 ProductListItem[]
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 @id @default(autoincrement())
605
+ id Int @id @default(autoincrement())
607
606
  title String
608
- description String? @db.Text
609
- metaData Json @default("{}")
607
+ description String? @db.Text
608
+ metaData Json @default("{}")
609
+ deactivated DateTime?
610
610
 
611
611
  productListId Int
612
- productList ProductList @relation(fields: [productListId], references: [id], onDelete: Cascade)
613
- optins OptinToProductListItem[]
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 Int
620
+ campaignId Int
621
621
  productListId Int
622
622
 
623
- campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)
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 Int
632
+ optInId Int
633
633
  productListItemId Int
634
634
 
635
- optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)
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 Int @default(autoincrement()) @id
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?
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 OptInVariable[]
760
- optInSteps OptInStep[]
761
- chat Chat?
762
- campaignInvites CampaignInvite[]
763
- trolleyPayments TrolleyPayment[]
764
- affiliateClicks AffiliateClick[]
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 Int @id @default(autoincrement())
774
- paymentId String @unique
775
- type trolleyPaymentType?
776
- status trolleyPaymentStatus
777
- optInId Int?
778
- paymentAmount Int
779
- metaData Json @default("{}")
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 OptIn? @relation(fields: [optInId], references:[id])
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,13 +853,54 @@ 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
+ @@map("socialpost")
861
+ }
860
862
 
861
- @@unique([platform, externalId])
863
+ // Table for storing archived socialposts from before external_id was implemented
864
+ model ArchivedSocialPost {
865
+ id Int @id @default(autoincrement())
866
+ phylloId String? @unique
867
+ metaData Json @default("{}")
868
+ lastFetched DateTime?
869
+ lastWebhook DateTime?
862
870
 
863
- @@map("socialpost")
871
+ // BASIC INFO
872
+ posted DateTime?
873
+ title String? @db.Text
874
+ description String? @db.Text
875
+ url String? @db.VarChar(2083)
876
+ urlPath String? @unique // DEPRECATED: This is here so we have some external identifier to quickly search by
877
+ format String?
878
+ type String?
879
+ platform String?
880
+ visibility String?
881
+ isSponsored Boolean?
882
+ hasCollaborators Boolean?
883
+ isOwnedByUser Boolean?
884
+ // METRICS
885
+ views Int?
886
+ impressions Int?
887
+ impressionsOrganic Int?
888
+ impressionsPaid Int?
889
+ reach Int?
890
+ reachOrganic Int?
891
+ reachPaid Int?
892
+ watchHours Float?
893
+ // ENGAGEMENT METRICS
894
+ likes Int?
895
+ dislikes Int?
896
+ comments Int?
897
+ saves Int?
898
+ shares Int?
899
+
900
+ userId Int?
901
+ campaignId Int?
902
+
903
+ @@map("archived_social_post")
864
904
  }
865
905
 
866
906
  model Image {
@@ -875,12 +915,12 @@ model Image {
875
915
  }
876
916
 
877
917
  model BrandImage {
878
- id Int @default(autoincrement()) @id
879
- url String @db.VarChar(2083)
880
- size String
881
- brandImageId Int
918
+ id Int @id @default(autoincrement())
919
+ url String @db.VarChar(2083)
920
+ size String
921
+ brandImageId Int
882
922
 
883
- brandImage BrandToImage @relation(fields: [brandImageId], references: [id], onDelete: Cascade)
923
+ brandImage BrandToImage @relation(fields: [brandImageId], references: [id], onDelete: Cascade)
884
924
 
885
925
  @@index([brandImageId])
886
926
  @@map("brandimage")
@@ -971,7 +1011,7 @@ model AffiliateClick {
971
1011
 
972
1012
  affiliateLinkId Int
973
1013
 
974
- optin OptIn @relation(fields: [optInId], references: [id])
1014
+ optin OptIn @relation(fields: [optInId], references: [id])
975
1015
  affiliateLink AffiliateLink @relation(fields: [affiliateLinkId], references: [id])
976
1016
  affiliateEvent AffiliateEvent[]
977
1017
  }
@@ -1007,22 +1047,22 @@ model SavedFile {
1007
1047
  }
1008
1048
 
1009
1049
  model CampaignInvite {
1010
- id Int @default(autoincrement()) @id
1011
- socialProfileId Int?
1012
- brandId Int
1013
- campaignId Int?
1014
- optInId Int? @unique
1015
- code String? @unique
1016
- createdAt DateTime @default(now())
1017
- declineDate DateTime?
1018
- declineReason String? @db.Text
1019
-
1020
- metaData Json? @default("{}")
1021
-
1022
- brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
1023
- campaign Campaign? @relation(fields: [campaignId], references: [id])
1024
- socialProfile SocialProfile? @relation(fields: [socialProfileId], references: [id])
1025
- optIn OptIn? @relation(fields: [optInId], references: [id])
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])
1026
1066
 
1027
1067
  @@index([socialProfileId])
1028
1068
  }
@@ -1041,7 +1081,7 @@ model CreatorList {
1041
1081
  campaign Campaign? @relation(fields: [campaignId], references: [id])
1042
1082
  sequences Sequence[]
1043
1083
 
1044
- @@index ([brandId])
1084
+ @@index([brandId])
1045
1085
  @@map("creatorlist")
1046
1086
  }
1047
1087
 
@@ -1091,9 +1131,9 @@ model SocialProfile {
1091
1131
  created DateTime @default(now())
1092
1132
  updated DateTime?
1093
1133
 
1094
- creatorListItems CreatorListItem[]
1095
- campaignInvites CampaignInvite[]
1096
- user User? @relation(fields: [userId], references: [id])
1134
+ creatorListItems CreatorListItem[]
1135
+ campaignInvites CampaignInvite[]
1136
+ user User? @relation(fields: [userId], references: [id])
1097
1137
 
1098
1138
  @@index(username)
1099
1139
  @@index(userId)
@@ -1113,16 +1153,16 @@ model MessageTemplate {
1113
1153
  }
1114
1154
 
1115
1155
  model EmailTemplate {
1116
- id Int @id @default(autoincrement())
1117
- label String?
1118
- subject String?
1119
- template String @db.Text
1120
- brandId Int?
1156
+ id Int @id @default(autoincrement())
1157
+ label String?
1158
+ subject String?
1159
+ template String @db.Text
1160
+ brandId Int?
1121
1161
 
1122
- brand Brand? @relation(fields: [brandId], references: [id])
1123
- metaData Json @default("{}") // to save any additional data such as user defined variables
1162
+ brand Brand? @relation(fields: [brandId], references: [id])
1163
+ metaData Json @default("{}") // to save any additional data such as user defined variables
1124
1164
 
1125
- sequenceSteps SequenceStep[]
1165
+ sequenceSteps SequenceStep[]
1126
1166
 
1127
1167
  @@index([brandId])
1128
1168
  }
@@ -1186,18 +1226,19 @@ model RakutenActivity {
1186
1226
 
1187
1227
  @@map("rakutenactivity")
1188
1228
  }
1229
+
1189
1230
  model ImpactRadiusEvent {
1190
- id Int @id @default(autoincrement())
1191
- type String // action/click
1192
- created DateTime @default(now())
1193
- amount Float?
1194
- commission Float?
1195
- metaData Json @default("{}")
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("{}")
1196
1237
 
1197
- userId Int
1238
+ userId Int
1198
1239
  brandId Int?
1199
1240
 
1200
- user User @relation(fields: [userId], references: [id])
1241
+ user User @relation(fields: [userId], references: [id])
1201
1242
  brand Brand? @relation(fields: [brandId], references: [id])
1202
1243
  }
1203
1244
 
@@ -1208,28 +1249,29 @@ model CreatorSearchFilter {
1208
1249
  filters Json @default("{}")
1209
1250
  createdAt DateTime @default(now())
1210
1251
  updatedAt DateTime?
1211
- brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
1252
+ brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)
1253
+
1212
1254
  @@map("creatorsearchfilter")
1213
1255
  }
1214
1256
 
1215
1257
  model Sequence {
1216
- id Int @id @default(autoincrement())
1217
- campaignId Int
1218
- creatorListId Int
1219
- title String @db.VarChar(255)
1220
- createdAt DateTime @default(now())
1221
- completed Boolean @default(false)
1222
- brandId Int
1223
- enabled Boolean @default(false)
1224
-
1225
- campaign Campaign @relation(fields: [campaignId], references: [id])
1226
- creatorList CreatorList @relation(fields: [creatorListId], references: [id])
1227
- brand Brand @relation(fields: [brandId], references: [id])
1228
-
1229
- steps SequenceStep[]
1230
- outboundEmails SequenceOutboundEmail[]
1231
- inboundEmails SequenceInboundEmail[]
1232
- imapCheckpoints SequenceImapCheckpoint[]
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[]
1233
1275
 
1234
1276
  @@map("sequence")
1235
1277
  }
@@ -1243,10 +1285,10 @@ model SequenceStep {
1243
1285
  order Int
1244
1286
  stepId Int
1245
1287
 
1246
- sequence Sequence @relation(fields: [sequenceId], references: [id], onDelete: Cascade)
1247
- emailTemplate EmailTemplate @relation(fields: [emailTemplateId], references: [id])
1288
+ sequence Sequence @relation(fields: [sequenceId], references: [id], onDelete: Cascade)
1289
+ emailTemplate EmailTemplate @relation(fields: [emailTemplateId], references: [id])
1248
1290
 
1249
- outboundEmails SequenceOutboundEmail[]
1291
+ outboundEmails SequenceOutboundEmail[]
1250
1292
 
1251
1293
  @@map("sequencestep")
1252
1294
  }
@@ -1258,9 +1300,9 @@ model SequenceOutboundEmail {
1258
1300
  sequenceStepId Int
1259
1301
  sentAt DateTime @default(now())
1260
1302
 
1261
- sequence Sequence @relation(fields: [sequenceId], references: [id])
1262
- creatorList CreatorListItem @relation(fields: [creatorListItemId], references: [id])
1263
- sequenceStep SequenceStep @relation(fields: [sequenceStepId], references: [id])
1303
+ sequence Sequence @relation(fields: [sequenceId], references: [id])
1304
+ creatorList CreatorListItem @relation(fields: [creatorListItemId], references: [id])
1305
+ sequenceStep SequenceStep @relation(fields: [sequenceStepId], references: [id])
1264
1306
 
1265
1307
  @@map("sequenceoutboundemail")
1266
1308
  }
@@ -1272,7 +1314,7 @@ model SequenceInboundEmail {
1272
1314
  receivedAt DateTime @default(now())
1273
1315
  msgHash String
1274
1316
 
1275
- sequence Sequence @relation(fields: [sequenceId], references: [id])
1317
+ sequence Sequence @relation(fields: [sequenceId], references: [id])
1276
1318
  creatorListId CreatorListItem @relation(fields: [creatorListItemId], references: [id])
1277
1319
 
1278
1320
  @@map("sequenceinboundemail")
@@ -1285,7 +1327,7 @@ model SequenceImapCheckpoint {
1285
1327
  createdAt DateTime @default(now())
1286
1328
  updatedAt DateTime @default(now())
1287
1329
 
1288
- sequence Sequence @relation(fields: [sequenceId], references: [id])
1330
+ sequence Sequence @relation(fields: [sequenceId], references: [id])
1289
1331
  creatorListId CreatorListItem @relation(fields: [creatorListItemId], references: [id])
1290
1332
 
1291
1333
  @@id([sequenceId, creatorListItemId])
@@ -1293,19 +1335,19 @@ model SequenceImapCheckpoint {
1293
1335
  }
1294
1336
 
1295
1337
  model ShopifyStore {
1296
- id Int @id @default(autoincrement())
1338
+ id Int @id @default(autoincrement())
1297
1339
  name String?
1298
1340
  url String
1299
- accessToken String? @map("access_token")
1341
+ accessToken String? @map("access_token")
1300
1342
  syncStatus ShopifyStoreSyncStatus @default(syncing) @map("sync_status")
1301
- lastSynced DateTime? @map("last_synced")
1302
- metaData Json @default("{}") @map("meta_data")
1343
+ lastSynced DateTime? @map("last_synced")
1344
+ metaData Json @default("{}") @map("meta_data")
1303
1345
 
1304
- brandId Int @map("brand_id")
1346
+ brandId Int @map("brand_id")
1305
1347
 
1306
- products ShopifyProduct[]
1348
+ products ShopifyProduct[]
1307
1349
 
1308
- brand Brand? @relation(fields: [brandId], references: [id], onDelete: Cascade)
1350
+ brand Brand? @relation(fields: [brandId], references: [id], onDelete: Cascade)
1309
1351
 
1310
1352
  @@index([brandId])
1311
1353
  @@map("shopify_store")
@@ -1318,18 +1360,18 @@ enum ShopifyStoreSyncStatus {
1318
1360
  }
1319
1361
 
1320
1362
  model ShopifyProduct {
1321
- id Int @id @default(autoincrement())
1322
- shopifyId String @unique @map("shopify_id")
1323
- title String
1324
- handle String
1325
- imageUrl String @db.Text @map("image_url")
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
1326
1368
 
1327
- metaData Json @default("{}") @map("meta_data")
1369
+ metaData Json @default("{}") @map("meta_data")
1328
1370
 
1329
- shopifyStoreId Int @map("shopify_store_id")
1371
+ shopifyStoreId Int @map("shopify_store_id")
1330
1372
 
1331
- campaignToShopifyProducts CampaignToShopifyProduct[]
1332
- variations ShopifyProductVariation[]
1373
+ campaignToShopifyProducts CampaignToShopifyProduct[]
1374
+ variations ShopifyProductVariation[]
1333
1375
 
1334
1376
  shopifyStore ShopifyStore @relation(fields: [shopifyStoreId], references: [id], onDelete: Cascade)
1335
1377
 
@@ -1337,14 +1379,14 @@ model ShopifyProduct {
1337
1379
  }
1338
1380
 
1339
1381
  model ShopifyProductVariation {
1340
- id Int @id @default(autoincrement())
1341
- shopifyId String @unique @map("shopify_id")
1342
- title String
1343
- imageUrl String @db.Text @map("image_url")
1382
+ id Int @id @default(autoincrement())
1383
+ shopifyId String @unique @map("shopify_id")
1384
+ title String
1385
+ imageUrl String @map("image_url") @db.Text
1344
1386
 
1345
- metaData Json @default("{}") @map("meta_data")
1387
+ metaData Json @default("{}") @map("meta_data")
1346
1388
 
1347
- shopifyProductId Int @map("shopify_product_id")
1389
+ shopifyProductId Int @map("shopify_product_id")
1348
1390
 
1349
1391
  shopifyProduct ShopifyProduct @relation(fields: [shopifyProductId], references: [id], onDelete: Cascade)
1350
1392
 
@@ -1352,11 +1394,11 @@ model ShopifyProductVariation {
1352
1394
  }
1353
1395
 
1354
1396
  model CampaignToShopifyProduct {
1355
- campaignId Int @map("campaign_id")
1356
- shopifyProductId Int @map("shopify_product_id")
1397
+ campaignId Int @map("campaign_id")
1398
+ shopifyProductId Int @map("shopify_product_id")
1357
1399
 
1358
- campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)
1359
- shopifyProduct ShopifyProduct @relation(fields: [shopifyProductId], references: [id], onDelete: Cascade)
1400
+ campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)
1401
+ shopifyProduct ShopifyProduct @relation(fields: [shopifyProductId], references: [id], onDelete: Cascade)
1360
1402
 
1361
1403
  @@id([campaignId, shopifyProductId])
1362
1404
  @@map("campaign_to_shopify_product")