@creator.co/creatorco-prisma-client 1.0.54 → 1.0.55
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 +7 -3
- package/index.js +11 -3
- package/libquery_engine-linux-musl-arm64-openssl-1.1.x.so.node +0 -0
- package/package.json +1 -1
- package/schema.prisma +1 -1
package/edge.js
CHANGED
|
@@ -1512,7 +1512,7 @@ const config = {
|
|
|
1512
1512
|
"value": "prisma-client-js"
|
|
1513
1513
|
},
|
|
1514
1514
|
"output": {
|
|
1515
|
-
"value": "/home/runner/github-runner-
|
|
1515
|
+
"value": "/home/runner/github-runner-ew1PhVMDrQF2N/creator-database/creator-database/client/creatorco/client",
|
|
1516
1516
|
"fromEnvVar": null
|
|
1517
1517
|
},
|
|
1518
1518
|
"config": {
|
|
@@ -1551,6 +1551,10 @@ const config = {
|
|
|
1551
1551
|
{
|
|
1552
1552
|
"fromEnvVar": null,
|
|
1553
1553
|
"value": "linux-arm64-openssl-1.0.x"
|
|
1554
|
+
},
|
|
1555
|
+
{
|
|
1556
|
+
"fromEnvVar": null,
|
|
1557
|
+
"value": "linux-musl-arm64-openssl-1.1.x"
|
|
1554
1558
|
}
|
|
1555
1559
|
],
|
|
1556
1560
|
"previewFeatures": [
|
|
@@ -1579,8 +1583,8 @@ const config = {
|
|
|
1579
1583
|
}
|
|
1580
1584
|
}
|
|
1581
1585
|
},
|
|
1582
|
-
"inlineSchema": "generator erd {\n provider = \"prisma-erd-generator\"\n includeRelationFromFields = true\n output = \"../../docs/creatorco_erd.md\"\n}\n\ngenerator kysely {\n provider = \"prisma-kysely\"\n output = \"../../client/creatorco/kysely\"\n fileName = \"types.ts\"\n enumFileName = \"enums.ts\"\n readOnlyIds = true\n camelCase = true\n jsonTypeOverride = Json\n}\n\ngenerator client {\n provider = \"prisma-client-js\"\n output = \"../../client/creatorco/client\"\n previewFeatures = [\"fullTextIndex\", \"fullTextSearch\"]\n // macos (arm or x86), native, linux arm64 ssl3.x, windows\n binaryTargets = [\"native\", \"darwin\", \"darwin-arm64\", \"linux-arm64-openssl-3.0.x\", \"windows\", \"debian-openssl-3.0.x\", \"linux-musl-arm64-openssl-3.0.x\", \"linux-arm64-openssl-1.0.x\"]\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_URL\")\n}\n\nmodel User {\n id Int @id @default(autoincrement())\n idmId String? @unique @map(\"idm_id\")\n role String\n email String? @unique\n password String?\n registered DateTime @default(now())\n lastLoginDate DateTime?\n firstName String?\n lastName String?\n phone String?\n phoneCode Int?\n phoneShort String?\n profilePicUrl String? @db.VarChar(2083)\n forgotPasswordKey String? @unique\n affiliateSlug String? @unique\n closed DateTime?\n closedReason String?\n usercomLastSynced DateTime? @default(now())\n extraData Json @default(\"{}\")\n\n referrerId Int?\n\n referrer User? @relation(\"Referrals\", fields: [referrerId], references: [id])\n referredUsers User[] @relation(\"Referrals\")\n logs Log[]\n creatorProfile CreatorProfile?\n instagramProfile InstagramProfile?\n youtubeProfile YoutubeProfile?\n tiktokProfile TiktokProfile?\n facebookProfile FacebookProfile?\n twitterProfile TwitterProfile?\n twitchProfile TwitchProfile?\n brandProfiles BrandUserProfile[]\n optIns OptIn[]\n assignedBrands Brand[]\n messages Message[]\n socialPosts SocialPost[]\n paymentTransactions PaymentTransaction[]\n affiliateLinks AffiliateLink[]\n campaignPins CampaignPin[]\n socialProfiles SocialProfile[]\n rakutenActivity RakutenActivity[]\n impactRadiusEvents ImpactRadiusEvent[]\n cjEvents CjEvent[]\n flagsAssigned CreatorFlag[] @relation(\"UserAssignedFlags\") // flags assigned to the user\n flagsCreated CreatorFlag[] @relation(\"UserCreatedFlags\") // flags created by the user\n flagsEdited CreatorFlag[] @relation(\"UserEditedFlags\") // flags edited by the user\n\n fullName String? @default(dbgenerated())\n phoneNormalised String? @default(dbgenerated())\n\n @@index([phoneCode, phone])\n @@map(\"user\")\n}\n\nmodel Log {\n id Int @id @default(autoincrement())\n\n userId Int?\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n data Json?\n}\n\nmodel CreatorProfile {\n id Int @id @default(autoincrement())\n country String?\n region String?\n birthDate DateTime?\n interests Json? // deprecated\n gender String?\n shippingAddress1 String?\n shippingAddress2 String?\n shippingCity String?\n shippingRegion String?\n shippingCountry String?\n shippingPostcode String?\n phylloUserId String?\n profileSlug String? @unique\n profileSettings Json?\n walletAddress String? @unique\n\n niches CreatorToCategory[]\n\n userId Int @unique\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@index(phylloUserId)\n @@map(\"creatorprofile\")\n}\n\nmodel InstagramProfile {\n id Int @id @default(autoincrement())\n instagramId String?\n\n // fields consistent accross profiles\n username String\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n fullName String? @db.VarChar(1024)\n isBusiness Boolean?\n isPrivate Boolean?\n isVerified Boolean?\n mediaCount Int?\n followingCount Int?\n totalComments Int?\n totalLikes Int?\n avgComments Float?\n avgLikes Float?\n bio String?\n externalUrl String? @db.VarChar(2083)\n hasHighlightReels Boolean?\n category String?\n hasClips Boolean?\n hasGuides Boolean?\n hasChannel Boolean?\n totalIgtvVideos Int?\n profilePicUrlHd String? @db.VarChar(2083) // DEPRECATED\n lastStoriesUpdate DateTime?\n\n extraData Json?\n phylloData Json?\n audienceData Json @default(\"{}\")\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n brandId Int? @unique\n brand Brand? @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@index(username)\n @@index(instagramId)\n @@map(\"instagramprofile\")\n}\n\nmodel TiktokProfile {\n id Int @id @default(autoincrement())\n tiktokId String @unique\n\n // fields consistent accross profiles\n username String?\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n handle String?\n nickname String?\n followingCount Int?\n totalComments Int?\n totalLikes Int?\n\n extraData Json?\n phylloData Json?\n audienceData Json @default(\"{}\")\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n brandId Int? @unique\n brand Brand? @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@index(username)\n @@map(\"tiktokprofile\")\n}\n\nmodel YoutubeProfile {\n id Int @id @default(autoincrement())\n youtubeId String @unique\n\n // fields consistent accross profiles\n username String\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n followingCount Int?\n fullName String? @db.VarChar(1024)\n isVerified Boolean?\n subscribers Int?\n description String? @db.Text\n country String?\n totalViews Int?\n totalVideos Int?\n\n extraData Json?\n phylloData Json?\n audienceData Json @default(\"{}\")\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n brandId Int? @unique\n brand Brand? @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@index(username)\n @@map(\"youtubeprofile\")\n}\n\nmodel TwitchProfile {\n id Int @id @default(autoincrement())\n twitchId String @unique\n\n // fields consistent accross profiles\n username String @unique\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n extraData Json?\n phylloData Json?\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@map(\"twitchprofile\")\n}\n\nmodel FacebookProfile {\n id Int @id @default(autoincrement())\n facebookId String @unique\n\n // fields consistent accross profiles\n username String @unique\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n extraData Json?\n phylloData Json?\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@map(\"facebookprofile\")\n}\n\nmodel TwitterProfile {\n id Int @id @default(autoincrement())\n twitterId String @unique\n\n // fields consistent accross profiles\n username String @unique\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n extraData Json?\n phylloData Json?\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@map(\"twitterprofile\")\n}\n\nmodel BrandUserProfile {\n id Int @id @default(autoincrement())\n userId Int\n brandId Int\n agencyPrivileges Boolean @default(false) @map(\"agency_privileges\")\n\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@index([userId])\n @@index([brandId])\n @@map(\"branduserprofile\")\n}\n\nmodel Brand {\n id Int @id @default(autoincrement())\n name String\n description String? @db.Text\n website String\n monthlyContacts Int?\n monthlyReports Int?\n lastContactDistribution DateTime?\n logoUrl String? @db.VarChar(2083)\n affiliateBaseUrl String? @db.VarChar(2083)\n affiliateCommission Float?\n extraData Json @default(\"{}\")\n\n specialistId Int?\n dedicatedSpecialist User? @relation(fields: [specialistId], references: [id])\n instagramProfile InstagramProfile?\n youtubeProfile YoutubeProfile?\n tiktokProfile TiktokProfile?\n campaigns Campaign[]\n brandUsers BrandUserProfile[]\n searchContacts SearchContacts[]\n reportCredits ReportCredits[]\n categories BrandToCategory[]\n paymentTransactions PaymentTransaction[]\n savedfiles SavedFile[]\n creatorLists CreatorList[]\n affiliateLinks BrandAffiliateLink[]\n messageTemplate MessageTemplate[]\n emailTemplates EmailTemplate[]\n socialListeningLists SocialListeningList[]\n campaignInvites CampaignInvite[]\n images BrandToImage[]\n creatorsearchfilter CreatorSearchFilter[]\n sequences Sequence[]\n impactRadiusEvents ImpactRadiusEvent[]\n cjEvents CjEvent[]\n shopifyStores ShopifyStore[]\n productLists ProductList[]\n\n // for agencies\n parentBrandId Int?\n parentBrand Brand? @relation(\"ChildBrands\", fields: [parentBrandId], references: [id])\n childBrands Brand[] @relation(\"ChildBrands\")\n // generated (for search)\n searchName String? @default(dbgenerated())\n\n @@map(\"brand\")\n}\n\nmodel SearchContacts {\n id Int @id @default(autoincrement())\n type String\n prevQty Float\n changeQty Float\n currentQty Float\n created DateTime? @default(now())\n\n prevQtyPostId Int? @unique\n prevQtyPost SearchContacts? @relation(\"prevSearchQtyPostId\", fields: [prevQtyPostId], references: [id])\n nextQtyPost SearchContacts? @relation(\"prevSearchQtyPostId\")\n\n brandId Int\n brand Brand @relation(fields: [brandId], references: [id])\n\n @@map(\"searchcontacts\")\n}\n\nmodel ReportCredits {\n id Int @id @default(autoincrement())\n type String\n prevQty Float\n changeQty Float\n currentQty Float\n created DateTime? @default(now())\n\n prevQtyPostId Int? @unique\n prevQtyPost ReportCredits? @relation(\"prevReportsQtyPostId\", fields: [prevQtyPostId], references: [id])\n nextQtyPost ReportCredits? @relation(\"prevReportsQtyPostId\")\n\n brandId Int\n brand Brand @relation(fields: [brandId], references: [id])\n\n @@map(\"reportcredits\")\n}\n\nmodel BrandToImage {\n id Int @id @default(autoincrement())\n brandId Int\n type String\n\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n sizes BrandImage[]\n\n @@index([brandId])\n @@map(\"brandtoimage\")\n}\n\nmodel BrandToCategory {\n brandId Int\n categoryId Int\n\n campaign Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n category Category @relation(fields: [categoryId], references: [id])\n\n @@id([brandId, categoryId])\n @@map(\"brandtocategory\")\n}\n\nmodel CreatorToCategory {\n creatorProfileId Int\n categoryId Int\n\n creatorProfile CreatorProfile @relation(fields: [creatorProfileId], references: [id], onDelete: Cascade)\n category Category @relation(fields: [categoryId], references: [id])\n\n @@id([creatorProfileId, categoryId])\n}\n\nmodel Chat {\n id Int @id @default(autoincrement())\n created DateTime? @default(now())\n conversationId String? @unique\n metaData Json @default(\"{}\")\n\n optInId Int? @unique\n\n optIn OptIn? @relation(fields: [optInId], references: [id])\n messages Message[]\n\n @@map(\"chat\")\n}\n\nmodel Message {\n id Int @id @default(autoincrement())\n created DateTime? @default(now())\n sender String\n content String @db.Text\n read Boolean @default(false)\n type String @default(\"text\")\n messageSid String?\n\n userId Int?\n chatId Int\n\n user User? @relation(fields: [userId], references: [id])\n chat Chat @relation(fields: [chatId], references: [id], onDelete: Cascade)\n\n @@index([chatId])\n @@map(\"message\")\n}\n\nmodel Campaign {\n id Int @id @default(autoincrement())\n title String\n slug String? @unique\n status String @default(\"draft\") // draft, paused, pending, private, publish, trash\n date DateTime @default(now())\n publishDate DateTime?\n sfSyncDate DateTime?\n description String? @db.Text\n productDescription String? @db.Text\n prizeDescription String? @db.Text\n strategy String? @default(\"shoutout\")\n socialChannel String?\n socialChannels Json?\n facebookReach Int?\n facebookEngagement Float?\n instagramReach Int?\n instagramEngagement Float?\n youtubeReach Int?\n youtubeEngagement Float?\n twitterReach Int?\n twitterEngagement Float?\n tiktokReach Int?\n tiktokEngagement Float?\n twitchReach Int?\n twitchEngagement Float?\n quantity Int @default(0)\n holdCost Float?\n value Float?\n paidAmount Float?\n minAge Int?\n maxAge Int?\n visuals String? @db.Text\n photoTags Json?\n hashtags Json?\n storyHashtags Json?\n storyMentions Json?\n caption String? @db.Text\n password String?\n contentFormats Json?\n paidCampaign Boolean?\n minPaidAmount Float?\n maxPaidAmount Float?\n paymentType String?\n monthlyActivatedGoal Int? // Redundant/Deprecated\n expectedOptIns Int? // Redundant/Deprecated\n goalActivations Float?\n goalOptIns Float?\n requiresShipping Boolean?\n disableQualifications Boolean?\n disableActivations Boolean?\n affiliateLinkPath String?\n metaData Json @default(\"{}\")\n\n steps CampaignStep[]\n categories CampaignToCategory[]\n optIns OptIn[]\n images CampaignToImage[]\n variables Variable[]\n productLists CampaignToProductList[]\n countries CampaignToCountry[]\n campaignPins CampaignPin[]\n socialPosts SocialPost[]\n campaignInvites CampaignInvite[]\n campaignToShopifyProducts CampaignToShopifyProduct[]\n campaignToBrandAffiliateLinks CampaignToBrandAffiliateLink[]\n linkedPosts CampaignToSocialPost[]\n\n brandId Int\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n creatorLists CreatorList[]\n optInViews OptInView[]\n sequences Sequence[]\n ExternalAffiliateClick ExternalAffiliateClick[]\n\n @@index([brandId])\n @@index([sfSyncDate])\n @@map(\"campaign\")\n}\n\nmodel CampaignPin {\n id Int @id @default(autoincrement())\n userId Int\n campaignId Int\n created DateTime @default(now())\n notified DateTime?\n\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n\n @@index([userId])\n @@map(\"campaignpin\")\n}\n\nmodel CampaignToImage {\n id Int @id @default(autoincrement())\n campaignId Int\n type String\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n\n sizes Image[]\n\n @@map(\"campaigntoimage\")\n}\n\nmodel CampaignToBrandAffiliateLink {\n campaignId Int\n brandAffiliateLinkId Int\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n brandAffiliateLink BrandAffiliateLink @relation(fields: [brandAffiliateLinkId], references: [id], onDelete: Cascade)\n\n @@id([campaignId, brandAffiliateLinkId])\n @@index([brandAffiliateLinkId])\n @@map(\"campaigntobrandaffiliatelink\")\n}\n\nmodel CampaignToCategory {\n campaignId Int\n categoryId Int\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n category Category @relation(fields: [categoryId], references: [id])\n\n @@id([campaignId, categoryId])\n @@map(\"campaigntocategory\")\n}\n\nmodel CampaignToCountry {\n campaignId Int\n countryId Int\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n country Country @relation(fields: [countryId], references: [id])\n\n @@id([campaignId, countryId])\n @@map(\"campaigntocountry\")\n}\n\nmodel ProductList {\n id Int @id @default(autoincrement())\n title String\n description String? @db.Text\n metaData Json @default(\"{}\")\n deactivated DateTime?\n\n brandId Int\n\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n items ProductListItem[]\n campaignProductLists CampaignToProductList[]\n\n @@index([brandId])\n @@map(\"product_list\")\n}\n\nmodel ProductListItem {\n id Int @id @default(autoincrement())\n title String\n description String? @db.Text\n metaData Json @default(\"{}\")\n deactivated DateTime?\n\n productListId Int\n productList ProductList @relation(fields: [productListId], references: [id], onDelete: Cascade)\n optins OptinToProductListItem[]\n\n @@index([productListId])\n @@map(\"product_list_item\")\n}\n\nmodel CampaignToProductList {\n campaignId Int\n productListId Int\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n productList ProductList @relation(fields: [productListId], references: [id])\n\n @@id([campaignId, productListId])\n @@index([productListId])\n @@map(\"campaign_to_product_list\")\n}\n\nmodel OptinToProductListItem {\n optInId Int\n productListItemId Int\n\n optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)\n productListItem ProductListItem @relation(fields: [productListItemId], references: [id], onDelete: Cascade)\n\n @@id([optInId, productListItemId])\n @@index([productListItemId])\n @@map(\"optin_to_product_list_item\")\n}\n\nmodel Variable {\n id Int @id @default(autoincrement())\n title String\n description String? @db.Text\n metaData Json @default(\"{}\")\n\n campaignId Int\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n\n options VariableOption[]\n optInVariables OptInVariable[]\n}\n\nmodel VariableOption {\n id Int @id @default(autoincrement())\n title String\n description String? @db.Text\n metaData Json @default(\"{}\")\n\n variableId Int\n\n variable Variable @relation(fields: [variableId], references: [id], onDelete: Cascade)\n\n optInVariables OptInVariable[]\n}\n\nmodel Step {\n id Int @id @default(autoincrement())\n slug String @unique\n title String?\n description String? @db.Text\n data Json?\n\n campaignSteps CampaignStep[]\n\n @@map(\"step\")\n}\n\nmodel CampaignStep {\n id Int @id @default(autoincrement())\n placement Int\n stepSettings Json?\n actionee String?\n instructions String? @db.Text\n customStepTitle String?\n customForm Json?\n metaData Json @default(\"{}\")\n campaignId Int\n stepId Int?\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n step Step? @relation(fields: [stepId], references: [id])\n currentOptIns OptIn[]\n\n optInSteps OptInStep[]\n\n @@index([campaignId])\n @@map(\"campaignstep\")\n}\n\nmodel OptInStep {\n id Int @id @default(autoincrement())\n completed DateTime?\n data Json?\n\n optInId Int\n campaignStepId Int\n socialPostId Int? // temporary for moving shoutoutData to socialPosts\n\n optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)\n campaignStep CampaignStep @relation(fields: [campaignStepId], references: [id], onDelete: Cascade)\n\n @@index([optInId])\n @@index([campaignStepId])\n @@map(\"optinstep\")\n}\n\nmodel Category {\n id Int @id @default(autoincrement())\n slug String @unique\n title String\n\n campaigns CampaignToCategory[]\n brands BrandToCategory[]\n creators CreatorToCategory[]\n\n @@map(\"category\")\n}\n\nmodel OptIn {\n id Int @id @default(autoincrement())\n status String @default(\"pending\")\n created DateTime @default(now())\n activated DateTime?\n completed DateTime?\n cancelled DateTime?\n cancelledData Json @default(\"{}\")\n cancelRequested DateTime?\n reinvited DateTime?\n seen Boolean @default(false)\n instructions String? @db.Text\n paymentAmount Float?\n paymentStatus String @default(\"pending\") // depracated -- refer to trolley payment table\n extraData Json @default(\"{}\")\n favoritedDate DateTime?\n rating Json?\n\n userId Int\n campaignId Int\n currentStepId Int?\n\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n currentStep CampaignStep? @relation(fields: [currentStepId], references: [id])\n\n variables OptInVariable[]\n optInSteps OptInStep[]\n chat Chat?\n campaignInvites CampaignInvite[]\n trolleyPayments TrolleyPayment[]\n affiliateClicks AffiliateClick[]\n productListItems OptinToProductListItem[]\n ExternalAffiliateClick ExternalAffiliateClick[]\n ImpactRadiusEvent ImpactRadiusEvent[]\n CjEvent CjEvent[]\n ShareASaleEvents ShareASaleEvent[]\n shopifyDiscountCodes ShopifyDiscountCode[]\n\n @@index([userId])\n @@index([campaignId])\n @@map(\"optin\")\n}\n\nmodel TrolleyPayment {\n id Int @id @default(autoincrement())\n paymentId String @unique\n type trolleyPaymentType?\n status trolleyPaymentStatus\n optInId Int?\n paymentAmount Int\n metaData Json @default(\"{}\")\n\n optIn OptIn? @relation(fields: [optInId], references: [id])\n}\n\nenum trolleyPaymentType {\n optIn\n tip\n affiliate\n}\n\nenum trolleyPaymentStatus {\n pending\n processing\n processed\n failed\n returned\n}\n\nmodel OptInVariable {\n id Int @id @default(autoincrement())\n\n optInId Int\n variableId Int\n selectedOptionId Int\n\n optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)\n variable Variable @relation(fields: [variableId], references: [id], onDelete: Cascade)\n selectedOption VariableOption @relation(fields: [selectedOptionId], references: [id], onDelete: Cascade)\n\n @@index([optInId])\n}\n\nmodel SocialPost {\n id Int @id @default(autoincrement())\n externalId String @map(\"external_id\")\n phylloId String? @unique\n metaData Json @default(\"{}\")\n lastFetched DateTime?\n lastWebhook DateTime?\n\n // BASIC INFO\n posted DateTime?\n title String? @db.Text\n description String? @db.Text\n url String? @db.VarChar(2083)\n format String?\n type String?\n platform String?\n visibility String?\n isSponsored Boolean?\n hasCollaborators Boolean?\n isOwnedByUser Boolean?\n // METRICS\n views Int?\n replays Int?\n impressions Int?\n impressionsOrganic Int?\n impressionsPaid Int?\n reach Int?\n reachOrganic Int?\n reachPaid Int?\n watchHours Float?\n // ENGAGEMENT METRICS\n likes Int?\n dislikes Int?\n comments Int?\n saves Int?\n shares Int?\n\n userId Int?\n campaignId Int?\n\n user User? @relation(fields: [userId], references: [id])\n campaign Campaign? @relation(fields: [campaignId], references: [id])\n lists ListToSocialPost[]\n campaigns CampaignToSocialPost[]\n\n @@unique([platform, externalId])\n @@index(campaignId)\n @@index(userId)\n @@index(posted)\n @@map(\"socialpost\")\n}\n\nenum CampaignToSocialPostStatus {\n pending\n approved\n declined\n}\n\nmodel CampaignToSocialPost {\n campaignId Int @map(\"campaign_id\")\n socialPostId Int @map(\"social_post_id\")\n\n status CampaignToSocialPostStatus @default(pending)\n created DateTime @default(now())\n metaData Json @default(\"{}\")\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n socialPost SocialPost @relation(fields: [socialPostId], references: [id], onDelete: Cascade)\n\n @@id([campaignId, socialPostId])\n @@index(status)\n @@map(\"campaign_to_social_post\")\n}\n\n// Table for storing archived socialposts from before external_id was implemented\nmodel ArchivedSocialPost {\n id Int @id @default(autoincrement())\n phylloId String? @unique\n metaData Json @default(\"{}\")\n lastFetched DateTime?\n lastWebhook DateTime?\n\n // BASIC INFO\n posted DateTime?\n title String? @db.Text\n description String? @db.Text\n url String? @db.VarChar(2083)\n urlPath String? @unique // DEPRECATED: This is here so we have some external identifier to quickly search by\n format String?\n type String?\n platform String?\n visibility String?\n isSponsored Boolean?\n hasCollaborators Boolean?\n isOwnedByUser Boolean?\n // METRICS\n views Int?\n impressions Int?\n impressionsOrganic Int?\n impressionsPaid Int?\n reach Int?\n reachOrganic Int?\n reachPaid Int?\n watchHours Float?\n // ENGAGEMENT METRICS\n likes Int?\n dislikes Int?\n comments Int?\n saves Int?\n shares Int?\n\n userId Int?\n campaignId Int?\n\n @@map(\"archived_social_post\")\n}\n\nmodel Image {\n id Int @id @default(autoincrement())\n url String @db.VarChar(2083)\n size String\n campaignImageId Int\n\n campaignImage CampaignToImage @relation(fields: [campaignImageId], references: [id], onDelete: Cascade)\n\n @@map(\"image\")\n}\n\nmodel BrandImage {\n id Int @id @default(autoincrement())\n url String @db.VarChar(2083)\n size String\n brandImageId Int\n\n brandImage BrandToImage @relation(fields: [brandImageId], references: [id], onDelete: Cascade)\n\n @@index([brandImageId])\n @@map(\"brandimage\")\n}\n\nmodel Country {\n id Int @id @default(autoincrement())\n countryCode String @unique @db.VarChar(2)\n countryName String @db.VarChar(500)\n teleCode String @db.VarChar(10)\n states State[]\n\n campaigns CampaignToCountry[]\n\n @@map(\"country\")\n}\n\nmodel State {\n id Int @id @default(autoincrement())\n countryId Int\n stateCode String @db.VarChar(50)\n stateName String @db.VarChar(500)\n\n country Country @relation(fields: [countryId], references: [id])\n\n @@map(\"state\")\n}\n\nmodel PaymentTransaction {\n id Int @id @default(autoincrement())\n amount Float\n balance Float\n type String\n date DateTime @default(now())\n notes String? @db.Text\n metaData Json @default(\"{}\")\n accountId Int\n\n brandId Int?\n creatorId Int?\n prevTransactionId Int? @unique\n\n brand Brand? @relation(fields: [brandId], references: [id])\n creator User? @relation(fields: [creatorId], references: [id])\n prevTransaction PaymentTransaction? @relation(\"TransactionHistory\", fields: [prevTransactionId], references: [id])\n nextTransaction PaymentTransaction? @relation(\"TransactionHistory\")\n\n @@index([accountId])\n}\n\nmodel ExternalAffiliateClick {\n id Int @id @default(autoincrement())\n program String\n created DateTime @default(now())\n ipv4 String?\n ipv6 String?\n linkUrl String\n metaData Json @default(\"{}\")\n\n optInId Int\n campaignId Int\n\n optin OptIn @relation(fields: [optInId], references: [id])\n campaign Campaign @relation(fields: [campaignId], references: [id])\n\n @@index([optInId])\n @@map(\"external_affiliate_click\")\n}\n\nmodel BrandAffiliateLink {\n id Int @id @default(autoincrement())\n created DateTime @default(now())\n description String?\n urlPath String\n commission Float @default(0.2)\n metaData Json @default(\"{}\")\n\n brandId Int\n affiliateLinks AffiliateLink[]\n campaignToBrandAffiliateLink CampaignToBrandAffiliateLink[]\n\n brand Brand @relation(fields: [brandId], references: [id])\n\n @@index([brandId])\n}\n\nmodel AffiliateLink {\n id Int @id @default(autoincrement())\n created DateTime @default(now())\n metaData Json @default(\"{}\")\n\n userId Int\n brandAffiliateLinkId Int\n affiliateClicks AffiliateClick[]\n\n affiliate User @relation(fields: [userId], references: [id])\n brandAffiliateLink BrandAffiliateLink @relation(fields: [brandAffiliateLinkId], references: [id])\n}\n\nmodel AffiliateClick {\n id Int @id @default(autoincrement())\n created DateTime @default(now())\n // visitorIp === IPv4\n visitorIp String?\n IPv6 String?\n optInId Int\n metaData Json @default(\"{}\")\n\n affiliateLinkId Int\n\n optin OptIn @relation(fields: [optInId], references: [id])\n affiliateLink AffiliateLink @relation(fields: [affiliateLinkId], references: [id])\n affiliateEvent AffiliateEvent[]\n}\n\nmodel AffiliateEvent {\n id Int @id @default(autoincrement())\n event String // click, purchase, etc.\n created DateTime @default(now())\n visitorIp String?\n urlPath String?\n revenue Float?\n commissionAmount Float?\n commissionPercent Float?\n metaData Json @default(\"{}\")\n\n affiliateClickId Int\n\n affiliateClick AffiliateClick? @relation(fields: [affiliateClickId], references: [id])\n}\n\nmodel SavedFile {\n id Int @id @default(autoincrement())\n title String?\n type String? // audience-report, search-export, campaign-invite\n url String?\n savedDate DateTime?\n metaData Json? @default(\"{}\")\n\n brandId Int?\n brand Brand? @relation(fields: [brandId], references: [id])\n\n @@map(\"savedfile\")\n}\n\nmodel CampaignInvite {\n id Int @id @default(autoincrement())\n socialProfileId Int?\n brandId Int\n campaignId Int?\n optInId Int? @unique\n code String? @unique\n createdAt DateTime @default(now())\n declineDate DateTime?\n declineReason String? @db.Text\n\n metaData Json? @default(\"{}\")\n\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n campaign Campaign? @relation(fields: [campaignId], references: [id])\n socialProfile SocialProfile? @relation(fields: [socialProfileId], references: [id])\n optIn OptIn? @relation(fields: [optInId], references: [id])\n\n @@index([socialProfileId])\n}\n\nmodel CreatorList {\n id Int @id @default(autoincrement())\n brandId Int\n campaignId Int?\n created DateTime @default(now())\n archived DateTime?\n title String\n metaData Json? @default(\"{}\")\n\n creators CreatorListItem[]\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n campaign Campaign? @relation(fields: [campaignId], references: [id])\n sequences Sequence[]\n\n @@index([brandId])\n @@map(\"creatorlist\")\n}\n\nmodel CreatorListItem {\n id Int @id @default(autoincrement())\n socialProfileId Int\n creatorListId Int\n\n saved DateTime @default(now())\n invited DateTime?\n tags Json?\n feedback String? @db.Text\n archived DateTime?\n metaData Json? @default(\"{}\")\n\n creatorList CreatorList @relation(fields: [creatorListId], references: [id], onDelete: Cascade)\n socialProfile SocialProfile? @relation(fields: [socialProfileId], references: [id], onDelete: Cascade)\n\n sequenceOutboundEmails SequenceOutboundEmail[]\n sequenceInboundEmails SequenceInboundEmail[]\n sequenceImapCheckpoints SequenceImapCheckpoint[]\n\n @@index([creatorListId])\n @@map(\"creatorlistitem\")\n}\n\nmodel SocialProfile {\n id Int @id @default(autoincrement())\n socialId String? @unique // need to make sure this can never overlap across multiple platforms, we should append the platform to the beginning to ensure it’s always unique\n userId Int? // registered user id, if available\n\n // social data\n platform String\n username String\n fullname String? @db.VarChar(1024)\n profileUrl String?\n profilePicUrl String? @db.VarChar(2083) // need to specify length, default size is too small\n followerCount Int?\n engagement Float?\n avgViews Int?\n verified Boolean?\n visibility String @default(\"public\")\n metaData Json @default(\"{}\")\n audienceData Json @default(\"{}\")\n phylloData Json @default(\"{}\")\n\n created DateTime @default(now())\n updated DateTime?\n\n creatorListItems CreatorListItem[]\n campaignInvites CampaignInvite[]\n user User? @relation(fields: [userId], references: [id])\n\n @@index(username)\n @@index(userId)\n @@map(\"socialprofile\")\n}\n\nmodel MessageTemplate {\n id Int @id @default(autoincrement())\n label String?\n template String @db.Text\n brandId Int?\n brand Brand? @relation(fields: [brandId], references: [id])\n metaData Json @default(\"{}\") // to save any additional data such as user defined variables\n\n @@index([brandId])\n @@map(\"messagetemplate\")\n}\n\nmodel EmailTemplate {\n id Int @id @default(autoincrement())\n label String?\n subject String?\n template String @db.Text\n brandId Int?\n\n brand Brand? @relation(fields: [brandId], references: [id])\n metaData Json @default(\"{}\") // to save any additional data such as user defined variables\n\n sequenceSteps SequenceStep[]\n\n @@index([brandId])\n}\n\nmodel SocialListeningList {\n id Int @id @default(autoincrement())\n brandId Int\n campaignId Int? @unique // optionally linked to a campaign\n created DateTime @default(now())\n updated DateTime?\n title String\n postType String // sponsored posts, top posts, or recent posts\n filters Json? @default(\"{}\") // filters to search posts by (location, date, hashtags, mentions, etc.)\n\n lastFetched DateTime? // last time posts were fetched\n\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n posts ListToSocialPost[]\n\n @@map(\"sociallisteninglist\")\n}\n\nmodel ListToSocialPost {\n id Int @id @default(autoincrement())\n listId Int\n postId Int\n\n list SocialListeningList @relation(fields: [listId], references: [id], onDelete: Cascade)\n socialPost SocialPost @relation(fields: [postId], references: [id], onDelete: Cascade)\n\n @@index([listId, postId])\n @@index([postId])\n @@map(\"listtosocialpost\")\n}\n\nmodel OptInView {\n id Int @id @default(autoincrement())\n title String\n filters Json @default(\"{}\")\n\n campaignId Int?\n campaign Campaign? @relation(fields: [campaignId], references: [id])\n\n @@map(\"optinview\")\n}\n\nmodel RakutenActivity {\n id Int @id @default(autoincrement())\n orderId String?\n metaData Json @default(\"{}\")\n created DateTime @default(now())\n clicks Int?\n orders Int?\n sales Float?\n commission Float?\n advertiserId Int?\n\n userId Int\n\n user User @relation(fields: [userId], references: [id])\n\n @@map(\"rakutenactivity\")\n}\n\nmodel ImpactRadiusEvent {\n id Int @id @default(autoincrement())\n type String // action/click\n created DateTime @default(now())\n amount Float?\n commission Float?\n metaData Json @default(\"{}\")\n\n userId Int\n brandId Int?\n optInId Int?\n\n user User @relation(fields: [userId], references: [id])\n brand Brand? @relation(fields: [brandId], references: [id])\n optIn OptIn? @relation(fields: [optInId], references: [id])\n}\n\nmodel CjEvent {\n id Int @id @default(autoincrement())\n type String // action/click\n created DateTime @default(now())\n amount Float?\n commission Float?\n metaData Json @default(\"{}\")\n\n userId Int\n brandId Int?\n optInId Int?\n\n user User @relation(fields: [userId], references: [id])\n brand Brand? @relation(fields: [brandId], references: [id])\n optIn OptIn? @relation(fields: [optInId], references: [id])\n\n @@map(\"cjevent\")\n}\n\nmodel ShareASaleEvent {\n id Int @id @default(autoincrement())\n transactionId String? @unique @map(\"transaction_id\")\n created DateTime @default(now())\n saleAmount Decimal? @map(\"sale_amount\") @db.Decimal(9, 2)\n commission Decimal? @db.Decimal(9, 2)\n metaData Json @default(\"{}\") @map(\"meta_data\")\n\n optInId Int? @map(\"optin_id\")\n\n optIn OptIn? @relation(fields: [optInId], references: [id])\n\n @@map(\"shareasale_event\")\n}\n\nmodel CreatorSearchFilter {\n id Int @id @default(autoincrement())\n brandId Int\n title String\n filters Json @default(\"{}\")\n createdAt DateTime @default(now())\n updatedAt DateTime?\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@map(\"creatorsearchfilter\")\n}\n\nmodel Sequence {\n id Int @id @default(autoincrement())\n campaignId Int\n creatorListId Int\n title String @db.VarChar(255)\n createdAt DateTime @default(now())\n completed Boolean @default(false)\n brandId Int\n enabled Boolean @default(false)\n\n campaign Campaign @relation(fields: [campaignId], references: [id])\n creatorList CreatorList @relation(fields: [creatorListId], references: [id])\n brand Brand @relation(fields: [brandId], references: [id])\n\n steps SequenceStep[]\n outboundEmails SequenceOutboundEmail[]\n inboundEmails SequenceInboundEmail[]\n imapCheckpoints SequenceImapCheckpoint[]\n\n @@map(\"sequence\")\n}\n\nmodel SequenceStep {\n id Int @id @default(autoincrement())\n sequenceId Int\n createdAt DateTime @default(now())\n emailTemplateId Int\n daysAfterPrevious Int\n order Int\n stepId Int\n\n sequence Sequence @relation(fields: [sequenceId], references: [id], onDelete: Cascade)\n emailTemplate EmailTemplate @relation(fields: [emailTemplateId], references: [id])\n\n outboundEmails SequenceOutboundEmail[]\n\n @@map(\"sequencestep\")\n}\n\nmodel SequenceOutboundEmail {\n id Int @id @default(autoincrement())\n sequenceId Int\n creatorListItemId Int\n sequenceStepId Int\n sentAt DateTime @default(now())\n\n sequence Sequence @relation(fields: [sequenceId], references: [id])\n creatorList CreatorListItem @relation(fields: [creatorListItemId], references: [id])\n sequenceStep SequenceStep @relation(fields: [sequenceStepId], references: [id])\n\n @@map(\"sequenceoutboundemail\")\n}\n\nmodel SequenceInboundEmail {\n id Int @id @default(autoincrement())\n sequenceId Int\n creatorListItemId Int\n receivedAt DateTime @default(now())\n msgHash String\n\n sequence Sequence @relation(fields: [sequenceId], references: [id])\n creatorListId CreatorListItem @relation(fields: [creatorListItemId], references: [id])\n\n @@map(\"sequenceinboundemail\")\n}\n\nmodel SequenceImapCheckpoint {\n sequenceId Int\n creatorListItemId Int\n lastReadMsgDate DateTime @default(now())\n createdAt DateTime @default(now())\n updatedAt DateTime @default(now())\n\n sequence Sequence @relation(fields: [sequenceId], references: [id])\n creatorListId CreatorListItem @relation(fields: [creatorListItemId], references: [id])\n\n @@id([sequenceId, creatorListItemId])\n @@map(\"sequenceimapcheckpoint\")\n}\n\nmodel ShopifyStore {\n id Int @id @default(autoincrement())\n name String?\n url String\n accessToken String? @map(\"access_token\")\n syncStatus ShopifyStoreSyncStatus @default(syncing) @map(\"sync_status\")\n lastSynced DateTime? @map(\"last_synced\")\n metaData Json @default(\"{}\") @map(\"meta_data\")\n\n brandId Int @map(\"brand_id\")\n\n products ShopifyProduct[]\n\n brand Brand? @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@index([brandId])\n @@map(\"shopify_store\")\n}\n\nenum ShopifyStoreSyncStatus {\n syncing\n synced\n error\n}\n\nmodel ShopifyProduct {\n id Int @id @default(autoincrement())\n shopifyId String @unique @map(\"shopify_id\")\n title String\n handle String\n imageUrl String @map(\"image_url\") @db.Text\n\n metaData Json @default(\"{}\") @map(\"meta_data\")\n\n shopifyStoreId Int @map(\"shopify_store_id\")\n\n campaignToShopifyProducts CampaignToShopifyProduct[]\n variations ShopifyProductVariation[]\n\n shopifyStore ShopifyStore @relation(fields: [shopifyStoreId], references: [id], onDelete: Cascade)\n\n @@map(\"shopify_product\")\n}\n\nmodel ShopifyProductVariation {\n id Int @id @default(autoincrement())\n shopifyId String @unique @map(\"shopify_id\")\n title String\n imageUrl String @map(\"image_url\") @db.Text\n\n metaData Json @default(\"{}\") @map(\"meta_data\")\n\n shopifyProductId Int @map(\"shopify_product_id\")\n\n shopifyProduct ShopifyProduct @relation(fields: [shopifyProductId], references: [id], onDelete: Cascade)\n\n @@map(\"shopify_product_variation\")\n}\n\nmodel CampaignToShopifyProduct {\n campaignId Int @map(\"campaign_id\")\n shopifyProductId Int @map(\"shopify_product_id\")\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n shopifyProduct ShopifyProduct @relation(fields: [shopifyProductId], references: [id], onDelete: Cascade)\n\n @@id([campaignId, shopifyProductId])\n @@map(\"campaign_to_shopify_product\")\n}\n\nmodel ShopifyDiscountCode {\n id Int @id @default(autoincrement())\n code String @unique\n shopifyDiscountCodeId Int? @unique @map(\"shopify_discount_code_id\")\n shopifyPriceRuleId BigInt? @map(\"price_rule_id\")\n\n optInId Int @map(\"optin_id\")\n\n optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)\n\n shopifySales ShopifySale[]\n\n @@map(\"shopify_discount_code\")\n}\n\nmodel ShopifySale {\n id Int @id @default(autoincrement())\n amount Float\n metaData Json? @map(\"meta_data\")\n discountCodeId Int @map(\"discount_code_id\")\n created DateTime @default(now())\n\n discountCode ShopifyDiscountCode @relation(fields: [discountCodeId], references: [id], onDelete: Cascade)\n\n @@map(\"shopify_sale\")\n}\n\nmodel CreatorFlag {\n // Used by admins to flag creators for various reasons\n id Int @id @default(autoincrement())\n label String // reason for flagging (e.g. Scammer)\n comment String? @db.Text // optional comment from admin\n color String // customizable tag color\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n userId Int // user ID of the flagged creator\n user User @relation(\"UserAssignedFlags\", fields: [userId], references: [id])\n\n flaggedByUserId Int // user ID of the admin who flagged the creator\n flaggedByUser User @relation(\"UserCreatedFlags\", fields: [flaggedByUserId], references: [id])\n\n editedByUserId Int? // user ID of the admin who last edited the flag\n editedByUser User? @relation(\"UserEditedFlags\", fields: [editedByUserId], references: [id])\n}\n",
|
|
1583
|
-
"inlineSchemaHash": "
|
|
1586
|
+
"inlineSchema": "generator erd {\n provider = \"prisma-erd-generator\"\n includeRelationFromFields = true\n output = \"../../docs/creatorco_erd.md\"\n}\n\ngenerator kysely {\n provider = \"prisma-kysely\"\n output = \"../../client/creatorco/kysely\"\n fileName = \"types.ts\"\n enumFileName = \"enums.ts\"\n readOnlyIds = true\n camelCase = true\n jsonTypeOverride = Json\n}\n\ngenerator client {\n provider = \"prisma-client-js\"\n output = \"../../client/creatorco/client\"\n previewFeatures = [\"fullTextIndex\", \"fullTextSearch\"]\n // macos (arm or x86), native, linux arm64 ssl3.x, windows\n binaryTargets = [\"native\", \"darwin\", \"darwin-arm64\", \"linux-arm64-openssl-3.0.x\", \"windows\", \"debian-openssl-3.0.x\", \"linux-musl-arm64-openssl-3.0.x\", \"linux-arm64-openssl-1.0.x\", \"linux-musl-arm64-openssl-1.1.x\"]\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_URL\")\n}\n\nmodel User {\n id Int @id @default(autoincrement())\n idmId String? @unique @map(\"idm_id\")\n role String\n email String? @unique\n password String?\n registered DateTime @default(now())\n lastLoginDate DateTime?\n firstName String?\n lastName String?\n phone String?\n phoneCode Int?\n phoneShort String?\n profilePicUrl String? @db.VarChar(2083)\n forgotPasswordKey String? @unique\n affiliateSlug String? @unique\n closed DateTime?\n closedReason String?\n usercomLastSynced DateTime? @default(now())\n extraData Json @default(\"{}\")\n\n referrerId Int?\n\n referrer User? @relation(\"Referrals\", fields: [referrerId], references: [id])\n referredUsers User[] @relation(\"Referrals\")\n logs Log[]\n creatorProfile CreatorProfile?\n instagramProfile InstagramProfile?\n youtubeProfile YoutubeProfile?\n tiktokProfile TiktokProfile?\n facebookProfile FacebookProfile?\n twitterProfile TwitterProfile?\n twitchProfile TwitchProfile?\n brandProfiles BrandUserProfile[]\n optIns OptIn[]\n assignedBrands Brand[]\n messages Message[]\n socialPosts SocialPost[]\n paymentTransactions PaymentTransaction[]\n affiliateLinks AffiliateLink[]\n campaignPins CampaignPin[]\n socialProfiles SocialProfile[]\n rakutenActivity RakutenActivity[]\n impactRadiusEvents ImpactRadiusEvent[]\n cjEvents CjEvent[]\n flagsAssigned CreatorFlag[] @relation(\"UserAssignedFlags\") // flags assigned to the user\n flagsCreated CreatorFlag[] @relation(\"UserCreatedFlags\") // flags created by the user\n flagsEdited CreatorFlag[] @relation(\"UserEditedFlags\") // flags edited by the user\n\n fullName String? @default(dbgenerated())\n phoneNormalised String? @default(dbgenerated())\n\n @@index([phoneCode, phone])\n @@map(\"user\")\n}\n\nmodel Log {\n id Int @id @default(autoincrement())\n\n userId Int?\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n data Json?\n}\n\nmodel CreatorProfile {\n id Int @id @default(autoincrement())\n country String?\n region String?\n birthDate DateTime?\n interests Json? // deprecated\n gender String?\n shippingAddress1 String?\n shippingAddress2 String?\n shippingCity String?\n shippingRegion String?\n shippingCountry String?\n shippingPostcode String?\n phylloUserId String?\n profileSlug String? @unique\n profileSettings Json?\n walletAddress String? @unique\n\n niches CreatorToCategory[]\n\n userId Int @unique\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@index(phylloUserId)\n @@map(\"creatorprofile\")\n}\n\nmodel InstagramProfile {\n id Int @id @default(autoincrement())\n instagramId String?\n\n // fields consistent accross profiles\n username String\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n fullName String? @db.VarChar(1024)\n isBusiness Boolean?\n isPrivate Boolean?\n isVerified Boolean?\n mediaCount Int?\n followingCount Int?\n totalComments Int?\n totalLikes Int?\n avgComments Float?\n avgLikes Float?\n bio String?\n externalUrl String? @db.VarChar(2083)\n hasHighlightReels Boolean?\n category String?\n hasClips Boolean?\n hasGuides Boolean?\n hasChannel Boolean?\n totalIgtvVideos Int?\n profilePicUrlHd String? @db.VarChar(2083) // DEPRECATED\n lastStoriesUpdate DateTime?\n\n extraData Json?\n phylloData Json?\n audienceData Json @default(\"{}\")\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n brandId Int? @unique\n brand Brand? @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@index(username)\n @@index(instagramId)\n @@map(\"instagramprofile\")\n}\n\nmodel TiktokProfile {\n id Int @id @default(autoincrement())\n tiktokId String @unique\n\n // fields consistent accross profiles\n username String?\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n handle String?\n nickname String?\n followingCount Int?\n totalComments Int?\n totalLikes Int?\n\n extraData Json?\n phylloData Json?\n audienceData Json @default(\"{}\")\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n brandId Int? @unique\n brand Brand? @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@index(username)\n @@map(\"tiktokprofile\")\n}\n\nmodel YoutubeProfile {\n id Int @id @default(autoincrement())\n youtubeId String @unique\n\n // fields consistent accross profiles\n username String\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n followingCount Int?\n fullName String? @db.VarChar(1024)\n isVerified Boolean?\n subscribers Int?\n description String? @db.Text\n country String?\n totalViews Int?\n totalVideos Int?\n\n extraData Json?\n phylloData Json?\n audienceData Json @default(\"{}\")\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n brandId Int? @unique\n brand Brand? @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@index(username)\n @@map(\"youtubeprofile\")\n}\n\nmodel TwitchProfile {\n id Int @id @default(autoincrement())\n twitchId String @unique\n\n // fields consistent accross profiles\n username String @unique\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n extraData Json?\n phylloData Json?\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@map(\"twitchprofile\")\n}\n\nmodel FacebookProfile {\n id Int @id @default(autoincrement())\n facebookId String @unique\n\n // fields consistent accross profiles\n username String @unique\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n extraData Json?\n phylloData Json?\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@map(\"facebookprofile\")\n}\n\nmodel TwitterProfile {\n id Int @id @default(autoincrement())\n twitterId String @unique\n\n // fields consistent accross profiles\n username String @unique\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n extraData Json?\n phylloData Json?\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@map(\"twitterprofile\")\n}\n\nmodel BrandUserProfile {\n id Int @id @default(autoincrement())\n userId Int\n brandId Int\n agencyPrivileges Boolean @default(false) @map(\"agency_privileges\")\n\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@index([userId])\n @@index([brandId])\n @@map(\"branduserprofile\")\n}\n\nmodel Brand {\n id Int @id @default(autoincrement())\n name String\n description String? @db.Text\n website String\n monthlyContacts Int?\n monthlyReports Int?\n lastContactDistribution DateTime?\n logoUrl String? @db.VarChar(2083)\n affiliateBaseUrl String? @db.VarChar(2083)\n affiliateCommission Float?\n extraData Json @default(\"{}\")\n\n specialistId Int?\n dedicatedSpecialist User? @relation(fields: [specialistId], references: [id])\n instagramProfile InstagramProfile?\n youtubeProfile YoutubeProfile?\n tiktokProfile TiktokProfile?\n campaigns Campaign[]\n brandUsers BrandUserProfile[]\n searchContacts SearchContacts[]\n reportCredits ReportCredits[]\n categories BrandToCategory[]\n paymentTransactions PaymentTransaction[]\n savedfiles SavedFile[]\n creatorLists CreatorList[]\n affiliateLinks BrandAffiliateLink[]\n messageTemplate MessageTemplate[]\n emailTemplates EmailTemplate[]\n socialListeningLists SocialListeningList[]\n campaignInvites CampaignInvite[]\n images BrandToImage[]\n creatorsearchfilter CreatorSearchFilter[]\n sequences Sequence[]\n impactRadiusEvents ImpactRadiusEvent[]\n cjEvents CjEvent[]\n shopifyStores ShopifyStore[]\n productLists ProductList[]\n\n // for agencies\n parentBrandId Int?\n parentBrand Brand? @relation(\"ChildBrands\", fields: [parentBrandId], references: [id])\n childBrands Brand[] @relation(\"ChildBrands\")\n // generated (for search)\n searchName String? @default(dbgenerated())\n\n @@map(\"brand\")\n}\n\nmodel SearchContacts {\n id Int @id @default(autoincrement())\n type String\n prevQty Float\n changeQty Float\n currentQty Float\n created DateTime? @default(now())\n\n prevQtyPostId Int? @unique\n prevQtyPost SearchContacts? @relation(\"prevSearchQtyPostId\", fields: [prevQtyPostId], references: [id])\n nextQtyPost SearchContacts? @relation(\"prevSearchQtyPostId\")\n\n brandId Int\n brand Brand @relation(fields: [brandId], references: [id])\n\n @@map(\"searchcontacts\")\n}\n\nmodel ReportCredits {\n id Int @id @default(autoincrement())\n type String\n prevQty Float\n changeQty Float\n currentQty Float\n created DateTime? @default(now())\n\n prevQtyPostId Int? @unique\n prevQtyPost ReportCredits? @relation(\"prevReportsQtyPostId\", fields: [prevQtyPostId], references: [id])\n nextQtyPost ReportCredits? @relation(\"prevReportsQtyPostId\")\n\n brandId Int\n brand Brand @relation(fields: [brandId], references: [id])\n\n @@map(\"reportcredits\")\n}\n\nmodel BrandToImage {\n id Int @id @default(autoincrement())\n brandId Int\n type String\n\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n sizes BrandImage[]\n\n @@index([brandId])\n @@map(\"brandtoimage\")\n}\n\nmodel BrandToCategory {\n brandId Int\n categoryId Int\n\n campaign Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n category Category @relation(fields: [categoryId], references: [id])\n\n @@id([brandId, categoryId])\n @@map(\"brandtocategory\")\n}\n\nmodel CreatorToCategory {\n creatorProfileId Int\n categoryId Int\n\n creatorProfile CreatorProfile @relation(fields: [creatorProfileId], references: [id], onDelete: Cascade)\n category Category @relation(fields: [categoryId], references: [id])\n\n @@id([creatorProfileId, categoryId])\n}\n\nmodel Chat {\n id Int @id @default(autoincrement())\n created DateTime? @default(now())\n conversationId String? @unique\n metaData Json @default(\"{}\")\n\n optInId Int? @unique\n\n optIn OptIn? @relation(fields: [optInId], references: [id])\n messages Message[]\n\n @@map(\"chat\")\n}\n\nmodel Message {\n id Int @id @default(autoincrement())\n created DateTime? @default(now())\n sender String\n content String @db.Text\n read Boolean @default(false)\n type String @default(\"text\")\n messageSid String?\n\n userId Int?\n chatId Int\n\n user User? @relation(fields: [userId], references: [id])\n chat Chat @relation(fields: [chatId], references: [id], onDelete: Cascade)\n\n @@index([chatId])\n @@map(\"message\")\n}\n\nmodel Campaign {\n id Int @id @default(autoincrement())\n title String\n slug String? @unique\n status String @default(\"draft\") // draft, paused, pending, private, publish, trash\n date DateTime @default(now())\n publishDate DateTime?\n sfSyncDate DateTime?\n description String? @db.Text\n productDescription String? @db.Text\n prizeDescription String? @db.Text\n strategy String? @default(\"shoutout\")\n socialChannel String?\n socialChannels Json?\n facebookReach Int?\n facebookEngagement Float?\n instagramReach Int?\n instagramEngagement Float?\n youtubeReach Int?\n youtubeEngagement Float?\n twitterReach Int?\n twitterEngagement Float?\n tiktokReach Int?\n tiktokEngagement Float?\n twitchReach Int?\n twitchEngagement Float?\n quantity Int @default(0)\n holdCost Float?\n value Float?\n paidAmount Float?\n minAge Int?\n maxAge Int?\n visuals String? @db.Text\n photoTags Json?\n hashtags Json?\n storyHashtags Json?\n storyMentions Json?\n caption String? @db.Text\n password String?\n contentFormats Json?\n paidCampaign Boolean?\n minPaidAmount Float?\n maxPaidAmount Float?\n paymentType String?\n monthlyActivatedGoal Int? // Redundant/Deprecated\n expectedOptIns Int? // Redundant/Deprecated\n goalActivations Float?\n goalOptIns Float?\n requiresShipping Boolean?\n disableQualifications Boolean?\n disableActivations Boolean?\n affiliateLinkPath String?\n metaData Json @default(\"{}\")\n\n steps CampaignStep[]\n categories CampaignToCategory[]\n optIns OptIn[]\n images CampaignToImage[]\n variables Variable[]\n productLists CampaignToProductList[]\n countries CampaignToCountry[]\n campaignPins CampaignPin[]\n socialPosts SocialPost[]\n campaignInvites CampaignInvite[]\n campaignToShopifyProducts CampaignToShopifyProduct[]\n campaignToBrandAffiliateLinks CampaignToBrandAffiliateLink[]\n linkedPosts CampaignToSocialPost[]\n\n brandId Int\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n creatorLists CreatorList[]\n optInViews OptInView[]\n sequences Sequence[]\n ExternalAffiliateClick ExternalAffiliateClick[]\n\n @@index([brandId])\n @@index([sfSyncDate])\n @@map(\"campaign\")\n}\n\nmodel CampaignPin {\n id Int @id @default(autoincrement())\n userId Int\n campaignId Int\n created DateTime @default(now())\n notified DateTime?\n\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n\n @@index([userId])\n @@map(\"campaignpin\")\n}\n\nmodel CampaignToImage {\n id Int @id @default(autoincrement())\n campaignId Int\n type String\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n\n sizes Image[]\n\n @@map(\"campaigntoimage\")\n}\n\nmodel CampaignToBrandAffiliateLink {\n campaignId Int\n brandAffiliateLinkId Int\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n brandAffiliateLink BrandAffiliateLink @relation(fields: [brandAffiliateLinkId], references: [id], onDelete: Cascade)\n\n @@id([campaignId, brandAffiliateLinkId])\n @@index([brandAffiliateLinkId])\n @@map(\"campaigntobrandaffiliatelink\")\n}\n\nmodel CampaignToCategory {\n campaignId Int\n categoryId Int\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n category Category @relation(fields: [categoryId], references: [id])\n\n @@id([campaignId, categoryId])\n @@map(\"campaigntocategory\")\n}\n\nmodel CampaignToCountry {\n campaignId Int\n countryId Int\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n country Country @relation(fields: [countryId], references: [id])\n\n @@id([campaignId, countryId])\n @@map(\"campaigntocountry\")\n}\n\nmodel ProductList {\n id Int @id @default(autoincrement())\n title String\n description String? @db.Text\n metaData Json @default(\"{}\")\n deactivated DateTime?\n\n brandId Int\n\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n items ProductListItem[]\n campaignProductLists CampaignToProductList[]\n\n @@index([brandId])\n @@map(\"product_list\")\n}\n\nmodel ProductListItem {\n id Int @id @default(autoincrement())\n title String\n description String? @db.Text\n metaData Json @default(\"{}\")\n deactivated DateTime?\n\n productListId Int\n productList ProductList @relation(fields: [productListId], references: [id], onDelete: Cascade)\n optins OptinToProductListItem[]\n\n @@index([productListId])\n @@map(\"product_list_item\")\n}\n\nmodel CampaignToProductList {\n campaignId Int\n productListId Int\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n productList ProductList @relation(fields: [productListId], references: [id])\n\n @@id([campaignId, productListId])\n @@index([productListId])\n @@map(\"campaign_to_product_list\")\n}\n\nmodel OptinToProductListItem {\n optInId Int\n productListItemId Int\n\n optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)\n productListItem ProductListItem @relation(fields: [productListItemId], references: [id], onDelete: Cascade)\n\n @@id([optInId, productListItemId])\n @@index([productListItemId])\n @@map(\"optin_to_product_list_item\")\n}\n\nmodel Variable {\n id Int @id @default(autoincrement())\n title String\n description String? @db.Text\n metaData Json @default(\"{}\")\n\n campaignId Int\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n\n options VariableOption[]\n optInVariables OptInVariable[]\n}\n\nmodel VariableOption {\n id Int @id @default(autoincrement())\n title String\n description String? @db.Text\n metaData Json @default(\"{}\")\n\n variableId Int\n\n variable Variable @relation(fields: [variableId], references: [id], onDelete: Cascade)\n\n optInVariables OptInVariable[]\n}\n\nmodel Step {\n id Int @id @default(autoincrement())\n slug String @unique\n title String?\n description String? @db.Text\n data Json?\n\n campaignSteps CampaignStep[]\n\n @@map(\"step\")\n}\n\nmodel CampaignStep {\n id Int @id @default(autoincrement())\n placement Int\n stepSettings Json?\n actionee String?\n instructions String? @db.Text\n customStepTitle String?\n customForm Json?\n metaData Json @default(\"{}\")\n campaignId Int\n stepId Int?\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n step Step? @relation(fields: [stepId], references: [id])\n currentOptIns OptIn[]\n\n optInSteps OptInStep[]\n\n @@index([campaignId])\n @@map(\"campaignstep\")\n}\n\nmodel OptInStep {\n id Int @id @default(autoincrement())\n completed DateTime?\n data Json?\n\n optInId Int\n campaignStepId Int\n socialPostId Int? // temporary for moving shoutoutData to socialPosts\n\n optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)\n campaignStep CampaignStep @relation(fields: [campaignStepId], references: [id], onDelete: Cascade)\n\n @@index([optInId])\n @@index([campaignStepId])\n @@map(\"optinstep\")\n}\n\nmodel Category {\n id Int @id @default(autoincrement())\n slug String @unique\n title String\n\n campaigns CampaignToCategory[]\n brands BrandToCategory[]\n creators CreatorToCategory[]\n\n @@map(\"category\")\n}\n\nmodel OptIn {\n id Int @id @default(autoincrement())\n status String @default(\"pending\")\n created DateTime @default(now())\n activated DateTime?\n completed DateTime?\n cancelled DateTime?\n cancelledData Json @default(\"{}\")\n cancelRequested DateTime?\n reinvited DateTime?\n seen Boolean @default(false)\n instructions String? @db.Text\n paymentAmount Float?\n paymentStatus String @default(\"pending\") // depracated -- refer to trolley payment table\n extraData Json @default(\"{}\")\n favoritedDate DateTime?\n rating Json?\n\n userId Int\n campaignId Int\n currentStepId Int?\n\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n currentStep CampaignStep? @relation(fields: [currentStepId], references: [id])\n\n variables OptInVariable[]\n optInSteps OptInStep[]\n chat Chat?\n campaignInvites CampaignInvite[]\n trolleyPayments TrolleyPayment[]\n affiliateClicks AffiliateClick[]\n productListItems OptinToProductListItem[]\n ExternalAffiliateClick ExternalAffiliateClick[]\n ImpactRadiusEvent ImpactRadiusEvent[]\n CjEvent CjEvent[]\n ShareASaleEvents ShareASaleEvent[]\n shopifyDiscountCodes ShopifyDiscountCode[]\n\n @@index([userId])\n @@index([campaignId])\n @@map(\"optin\")\n}\n\nmodel TrolleyPayment {\n id Int @id @default(autoincrement())\n paymentId String @unique\n type trolleyPaymentType?\n status trolleyPaymentStatus\n optInId Int?\n paymentAmount Int\n metaData Json @default(\"{}\")\n\n optIn OptIn? @relation(fields: [optInId], references: [id])\n}\n\nenum trolleyPaymentType {\n optIn\n tip\n affiliate\n}\n\nenum trolleyPaymentStatus {\n pending\n processing\n processed\n failed\n returned\n}\n\nmodel OptInVariable {\n id Int @id @default(autoincrement())\n\n optInId Int\n variableId Int\n selectedOptionId Int\n\n optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)\n variable Variable @relation(fields: [variableId], references: [id], onDelete: Cascade)\n selectedOption VariableOption @relation(fields: [selectedOptionId], references: [id], onDelete: Cascade)\n\n @@index([optInId])\n}\n\nmodel SocialPost {\n id Int @id @default(autoincrement())\n externalId String @map(\"external_id\")\n phylloId String? @unique\n metaData Json @default(\"{}\")\n lastFetched DateTime?\n lastWebhook DateTime?\n\n // BASIC INFO\n posted DateTime?\n title String? @db.Text\n description String? @db.Text\n url String? @db.VarChar(2083)\n format String?\n type String?\n platform String?\n visibility String?\n isSponsored Boolean?\n hasCollaborators Boolean?\n isOwnedByUser Boolean?\n // METRICS\n views Int?\n replays Int?\n impressions Int?\n impressionsOrganic Int?\n impressionsPaid Int?\n reach Int?\n reachOrganic Int?\n reachPaid Int?\n watchHours Float?\n // ENGAGEMENT METRICS\n likes Int?\n dislikes Int?\n comments Int?\n saves Int?\n shares Int?\n\n userId Int?\n campaignId Int?\n\n user User? @relation(fields: [userId], references: [id])\n campaign Campaign? @relation(fields: [campaignId], references: [id])\n lists ListToSocialPost[]\n campaigns CampaignToSocialPost[]\n\n @@unique([platform, externalId])\n @@index(campaignId)\n @@index(userId)\n @@index(posted)\n @@map(\"socialpost\")\n}\n\nenum CampaignToSocialPostStatus {\n pending\n approved\n declined\n}\n\nmodel CampaignToSocialPost {\n campaignId Int @map(\"campaign_id\")\n socialPostId Int @map(\"social_post_id\")\n\n status CampaignToSocialPostStatus @default(pending)\n created DateTime @default(now())\n metaData Json @default(\"{}\")\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n socialPost SocialPost @relation(fields: [socialPostId], references: [id], onDelete: Cascade)\n\n @@id([campaignId, socialPostId])\n @@index(status)\n @@map(\"campaign_to_social_post\")\n}\n\n// Table for storing archived socialposts from before external_id was implemented\nmodel ArchivedSocialPost {\n id Int @id @default(autoincrement())\n phylloId String? @unique\n metaData Json @default(\"{}\")\n lastFetched DateTime?\n lastWebhook DateTime?\n\n // BASIC INFO\n posted DateTime?\n title String? @db.Text\n description String? @db.Text\n url String? @db.VarChar(2083)\n urlPath String? @unique // DEPRECATED: This is here so we have some external identifier to quickly search by\n format String?\n type String?\n platform String?\n visibility String?\n isSponsored Boolean?\n hasCollaborators Boolean?\n isOwnedByUser Boolean?\n // METRICS\n views Int?\n impressions Int?\n impressionsOrganic Int?\n impressionsPaid Int?\n reach Int?\n reachOrganic Int?\n reachPaid Int?\n watchHours Float?\n // ENGAGEMENT METRICS\n likes Int?\n dislikes Int?\n comments Int?\n saves Int?\n shares Int?\n\n userId Int?\n campaignId Int?\n\n @@map(\"archived_social_post\")\n}\n\nmodel Image {\n id Int @id @default(autoincrement())\n url String @db.VarChar(2083)\n size String\n campaignImageId Int\n\n campaignImage CampaignToImage @relation(fields: [campaignImageId], references: [id], onDelete: Cascade)\n\n @@map(\"image\")\n}\n\nmodel BrandImage {\n id Int @id @default(autoincrement())\n url String @db.VarChar(2083)\n size String\n brandImageId Int\n\n brandImage BrandToImage @relation(fields: [brandImageId], references: [id], onDelete: Cascade)\n\n @@index([brandImageId])\n @@map(\"brandimage\")\n}\n\nmodel Country {\n id Int @id @default(autoincrement())\n countryCode String @unique @db.VarChar(2)\n countryName String @db.VarChar(500)\n teleCode String @db.VarChar(10)\n states State[]\n\n campaigns CampaignToCountry[]\n\n @@map(\"country\")\n}\n\nmodel State {\n id Int @id @default(autoincrement())\n countryId Int\n stateCode String @db.VarChar(50)\n stateName String @db.VarChar(500)\n\n country Country @relation(fields: [countryId], references: [id])\n\n @@map(\"state\")\n}\n\nmodel PaymentTransaction {\n id Int @id @default(autoincrement())\n amount Float\n balance Float\n type String\n date DateTime @default(now())\n notes String? @db.Text\n metaData Json @default(\"{}\")\n accountId Int\n\n brandId Int?\n creatorId Int?\n prevTransactionId Int? @unique\n\n brand Brand? @relation(fields: [brandId], references: [id])\n creator User? @relation(fields: [creatorId], references: [id])\n prevTransaction PaymentTransaction? @relation(\"TransactionHistory\", fields: [prevTransactionId], references: [id])\n nextTransaction PaymentTransaction? @relation(\"TransactionHistory\")\n\n @@index([accountId])\n}\n\nmodel ExternalAffiliateClick {\n id Int @id @default(autoincrement())\n program String\n created DateTime @default(now())\n ipv4 String?\n ipv6 String?\n linkUrl String\n metaData Json @default(\"{}\")\n\n optInId Int\n campaignId Int\n\n optin OptIn @relation(fields: [optInId], references: [id])\n campaign Campaign @relation(fields: [campaignId], references: [id])\n\n @@index([optInId])\n @@map(\"external_affiliate_click\")\n}\n\nmodel BrandAffiliateLink {\n id Int @id @default(autoincrement())\n created DateTime @default(now())\n description String?\n urlPath String\n commission Float @default(0.2)\n metaData Json @default(\"{}\")\n\n brandId Int\n affiliateLinks AffiliateLink[]\n campaignToBrandAffiliateLink CampaignToBrandAffiliateLink[]\n\n brand Brand @relation(fields: [brandId], references: [id])\n\n @@index([brandId])\n}\n\nmodel AffiliateLink {\n id Int @id @default(autoincrement())\n created DateTime @default(now())\n metaData Json @default(\"{}\")\n\n userId Int\n brandAffiliateLinkId Int\n affiliateClicks AffiliateClick[]\n\n affiliate User @relation(fields: [userId], references: [id])\n brandAffiliateLink BrandAffiliateLink @relation(fields: [brandAffiliateLinkId], references: [id])\n}\n\nmodel AffiliateClick {\n id Int @id @default(autoincrement())\n created DateTime @default(now())\n // visitorIp === IPv4\n visitorIp String?\n IPv6 String?\n optInId Int\n metaData Json @default(\"{}\")\n\n affiliateLinkId Int\n\n optin OptIn @relation(fields: [optInId], references: [id])\n affiliateLink AffiliateLink @relation(fields: [affiliateLinkId], references: [id])\n affiliateEvent AffiliateEvent[]\n}\n\nmodel AffiliateEvent {\n id Int @id @default(autoincrement())\n event String // click, purchase, etc.\n created DateTime @default(now())\n visitorIp String?\n urlPath String?\n revenue Float?\n commissionAmount Float?\n commissionPercent Float?\n metaData Json @default(\"{}\")\n\n affiliateClickId Int\n\n affiliateClick AffiliateClick? @relation(fields: [affiliateClickId], references: [id])\n}\n\nmodel SavedFile {\n id Int @id @default(autoincrement())\n title String?\n type String? // audience-report, search-export, campaign-invite\n url String?\n savedDate DateTime?\n metaData Json? @default(\"{}\")\n\n brandId Int?\n brand Brand? @relation(fields: [brandId], references: [id])\n\n @@map(\"savedfile\")\n}\n\nmodel CampaignInvite {\n id Int @id @default(autoincrement())\n socialProfileId Int?\n brandId Int\n campaignId Int?\n optInId Int? @unique\n code String? @unique\n createdAt DateTime @default(now())\n declineDate DateTime?\n declineReason String? @db.Text\n\n metaData Json? @default(\"{}\")\n\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n campaign Campaign? @relation(fields: [campaignId], references: [id])\n socialProfile SocialProfile? @relation(fields: [socialProfileId], references: [id])\n optIn OptIn? @relation(fields: [optInId], references: [id])\n\n @@index([socialProfileId])\n}\n\nmodel CreatorList {\n id Int @id @default(autoincrement())\n brandId Int\n campaignId Int?\n created DateTime @default(now())\n archived DateTime?\n title String\n metaData Json? @default(\"{}\")\n\n creators CreatorListItem[]\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n campaign Campaign? @relation(fields: [campaignId], references: [id])\n sequences Sequence[]\n\n @@index([brandId])\n @@map(\"creatorlist\")\n}\n\nmodel CreatorListItem {\n id Int @id @default(autoincrement())\n socialProfileId Int\n creatorListId Int\n\n saved DateTime @default(now())\n invited DateTime?\n tags Json?\n feedback String? @db.Text\n archived DateTime?\n metaData Json? @default(\"{}\")\n\n creatorList CreatorList @relation(fields: [creatorListId], references: [id], onDelete: Cascade)\n socialProfile SocialProfile? @relation(fields: [socialProfileId], references: [id], onDelete: Cascade)\n\n sequenceOutboundEmails SequenceOutboundEmail[]\n sequenceInboundEmails SequenceInboundEmail[]\n sequenceImapCheckpoints SequenceImapCheckpoint[]\n\n @@index([creatorListId])\n @@map(\"creatorlistitem\")\n}\n\nmodel SocialProfile {\n id Int @id @default(autoincrement())\n socialId String? @unique // need to make sure this can never overlap across multiple platforms, we should append the platform to the beginning to ensure it’s always unique\n userId Int? // registered user id, if available\n\n // social data\n platform String\n username String\n fullname String? @db.VarChar(1024)\n profileUrl String?\n profilePicUrl String? @db.VarChar(2083) // need to specify length, default size is too small\n followerCount Int?\n engagement Float?\n avgViews Int?\n verified Boolean?\n visibility String @default(\"public\")\n metaData Json @default(\"{}\")\n audienceData Json @default(\"{}\")\n phylloData Json @default(\"{}\")\n\n created DateTime @default(now())\n updated DateTime?\n\n creatorListItems CreatorListItem[]\n campaignInvites CampaignInvite[]\n user User? @relation(fields: [userId], references: [id])\n\n @@index(username)\n @@index(userId)\n @@map(\"socialprofile\")\n}\n\nmodel MessageTemplate {\n id Int @id @default(autoincrement())\n label String?\n template String @db.Text\n brandId Int?\n brand Brand? @relation(fields: [brandId], references: [id])\n metaData Json @default(\"{}\") // to save any additional data such as user defined variables\n\n @@index([brandId])\n @@map(\"messagetemplate\")\n}\n\nmodel EmailTemplate {\n id Int @id @default(autoincrement())\n label String?\n subject String?\n template String @db.Text\n brandId Int?\n\n brand Brand? @relation(fields: [brandId], references: [id])\n metaData Json @default(\"{}\") // to save any additional data such as user defined variables\n\n sequenceSteps SequenceStep[]\n\n @@index([brandId])\n}\n\nmodel SocialListeningList {\n id Int @id @default(autoincrement())\n brandId Int\n campaignId Int? @unique // optionally linked to a campaign\n created DateTime @default(now())\n updated DateTime?\n title String\n postType String // sponsored posts, top posts, or recent posts\n filters Json? @default(\"{}\") // filters to search posts by (location, date, hashtags, mentions, etc.)\n\n lastFetched DateTime? // last time posts were fetched\n\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n posts ListToSocialPost[]\n\n @@map(\"sociallisteninglist\")\n}\n\nmodel ListToSocialPost {\n id Int @id @default(autoincrement())\n listId Int\n postId Int\n\n list SocialListeningList @relation(fields: [listId], references: [id], onDelete: Cascade)\n socialPost SocialPost @relation(fields: [postId], references: [id], onDelete: Cascade)\n\n @@index([listId, postId])\n @@index([postId])\n @@map(\"listtosocialpost\")\n}\n\nmodel OptInView {\n id Int @id @default(autoincrement())\n title String\n filters Json @default(\"{}\")\n\n campaignId Int?\n campaign Campaign? @relation(fields: [campaignId], references: [id])\n\n @@map(\"optinview\")\n}\n\nmodel RakutenActivity {\n id Int @id @default(autoincrement())\n orderId String?\n metaData Json @default(\"{}\")\n created DateTime @default(now())\n clicks Int?\n orders Int?\n sales Float?\n commission Float?\n advertiserId Int?\n\n userId Int\n\n user User @relation(fields: [userId], references: [id])\n\n @@map(\"rakutenactivity\")\n}\n\nmodel ImpactRadiusEvent {\n id Int @id @default(autoincrement())\n type String // action/click\n created DateTime @default(now())\n amount Float?\n commission Float?\n metaData Json @default(\"{}\")\n\n userId Int\n brandId Int?\n optInId Int?\n\n user User @relation(fields: [userId], references: [id])\n brand Brand? @relation(fields: [brandId], references: [id])\n optIn OptIn? @relation(fields: [optInId], references: [id])\n}\n\nmodel CjEvent {\n id Int @id @default(autoincrement())\n type String // action/click\n created DateTime @default(now())\n amount Float?\n commission Float?\n metaData Json @default(\"{}\")\n\n userId Int\n brandId Int?\n optInId Int?\n\n user User @relation(fields: [userId], references: [id])\n brand Brand? @relation(fields: [brandId], references: [id])\n optIn OptIn? @relation(fields: [optInId], references: [id])\n\n @@map(\"cjevent\")\n}\n\nmodel ShareASaleEvent {\n id Int @id @default(autoincrement())\n transactionId String? @unique @map(\"transaction_id\")\n created DateTime @default(now())\n saleAmount Decimal? @map(\"sale_amount\") @db.Decimal(9, 2)\n commission Decimal? @db.Decimal(9, 2)\n metaData Json @default(\"{}\") @map(\"meta_data\")\n\n optInId Int? @map(\"optin_id\")\n\n optIn OptIn? @relation(fields: [optInId], references: [id])\n\n @@map(\"shareasale_event\")\n}\n\nmodel CreatorSearchFilter {\n id Int @id @default(autoincrement())\n brandId Int\n title String\n filters Json @default(\"{}\")\n createdAt DateTime @default(now())\n updatedAt DateTime?\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@map(\"creatorsearchfilter\")\n}\n\nmodel Sequence {\n id Int @id @default(autoincrement())\n campaignId Int\n creatorListId Int\n title String @db.VarChar(255)\n createdAt DateTime @default(now())\n completed Boolean @default(false)\n brandId Int\n enabled Boolean @default(false)\n\n campaign Campaign @relation(fields: [campaignId], references: [id])\n creatorList CreatorList @relation(fields: [creatorListId], references: [id])\n brand Brand @relation(fields: [brandId], references: [id])\n\n steps SequenceStep[]\n outboundEmails SequenceOutboundEmail[]\n inboundEmails SequenceInboundEmail[]\n imapCheckpoints SequenceImapCheckpoint[]\n\n @@map(\"sequence\")\n}\n\nmodel SequenceStep {\n id Int @id @default(autoincrement())\n sequenceId Int\n createdAt DateTime @default(now())\n emailTemplateId Int\n daysAfterPrevious Int\n order Int\n stepId Int\n\n sequence Sequence @relation(fields: [sequenceId], references: [id], onDelete: Cascade)\n emailTemplate EmailTemplate @relation(fields: [emailTemplateId], references: [id])\n\n outboundEmails SequenceOutboundEmail[]\n\n @@map(\"sequencestep\")\n}\n\nmodel SequenceOutboundEmail {\n id Int @id @default(autoincrement())\n sequenceId Int\n creatorListItemId Int\n sequenceStepId Int\n sentAt DateTime @default(now())\n\n sequence Sequence @relation(fields: [sequenceId], references: [id])\n creatorList CreatorListItem @relation(fields: [creatorListItemId], references: [id])\n sequenceStep SequenceStep @relation(fields: [sequenceStepId], references: [id])\n\n @@map(\"sequenceoutboundemail\")\n}\n\nmodel SequenceInboundEmail {\n id Int @id @default(autoincrement())\n sequenceId Int\n creatorListItemId Int\n receivedAt DateTime @default(now())\n msgHash String\n\n sequence Sequence @relation(fields: [sequenceId], references: [id])\n creatorListId CreatorListItem @relation(fields: [creatorListItemId], references: [id])\n\n @@map(\"sequenceinboundemail\")\n}\n\nmodel SequenceImapCheckpoint {\n sequenceId Int\n creatorListItemId Int\n lastReadMsgDate DateTime @default(now())\n createdAt DateTime @default(now())\n updatedAt DateTime @default(now())\n\n sequence Sequence @relation(fields: [sequenceId], references: [id])\n creatorListId CreatorListItem @relation(fields: [creatorListItemId], references: [id])\n\n @@id([sequenceId, creatorListItemId])\n @@map(\"sequenceimapcheckpoint\")\n}\n\nmodel ShopifyStore {\n id Int @id @default(autoincrement())\n name String?\n url String\n accessToken String? @map(\"access_token\")\n syncStatus ShopifyStoreSyncStatus @default(syncing) @map(\"sync_status\")\n lastSynced DateTime? @map(\"last_synced\")\n metaData Json @default(\"{}\") @map(\"meta_data\")\n\n brandId Int @map(\"brand_id\")\n\n products ShopifyProduct[]\n\n brand Brand? @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@index([brandId])\n @@map(\"shopify_store\")\n}\n\nenum ShopifyStoreSyncStatus {\n syncing\n synced\n error\n}\n\nmodel ShopifyProduct {\n id Int @id @default(autoincrement())\n shopifyId String @unique @map(\"shopify_id\")\n title String\n handle String\n imageUrl String @map(\"image_url\") @db.Text\n\n metaData Json @default(\"{}\") @map(\"meta_data\")\n\n shopifyStoreId Int @map(\"shopify_store_id\")\n\n campaignToShopifyProducts CampaignToShopifyProduct[]\n variations ShopifyProductVariation[]\n\n shopifyStore ShopifyStore @relation(fields: [shopifyStoreId], references: [id], onDelete: Cascade)\n\n @@map(\"shopify_product\")\n}\n\nmodel ShopifyProductVariation {\n id Int @id @default(autoincrement())\n shopifyId String @unique @map(\"shopify_id\")\n title String\n imageUrl String @map(\"image_url\") @db.Text\n\n metaData Json @default(\"{}\") @map(\"meta_data\")\n\n shopifyProductId Int @map(\"shopify_product_id\")\n\n shopifyProduct ShopifyProduct @relation(fields: [shopifyProductId], references: [id], onDelete: Cascade)\n\n @@map(\"shopify_product_variation\")\n}\n\nmodel CampaignToShopifyProduct {\n campaignId Int @map(\"campaign_id\")\n shopifyProductId Int @map(\"shopify_product_id\")\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n shopifyProduct ShopifyProduct @relation(fields: [shopifyProductId], references: [id], onDelete: Cascade)\n\n @@id([campaignId, shopifyProductId])\n @@map(\"campaign_to_shopify_product\")\n}\n\nmodel ShopifyDiscountCode {\n id Int @id @default(autoincrement())\n code String @unique\n shopifyDiscountCodeId Int? @unique @map(\"shopify_discount_code_id\")\n shopifyPriceRuleId BigInt? @map(\"price_rule_id\")\n\n optInId Int @map(\"optin_id\")\n\n optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)\n\n shopifySales ShopifySale[]\n\n @@map(\"shopify_discount_code\")\n}\n\nmodel ShopifySale {\n id Int @id @default(autoincrement())\n amount Float\n metaData Json? @map(\"meta_data\")\n discountCodeId Int @map(\"discount_code_id\")\n created DateTime @default(now())\n\n discountCode ShopifyDiscountCode @relation(fields: [discountCodeId], references: [id], onDelete: Cascade)\n\n @@map(\"shopify_sale\")\n}\n\nmodel CreatorFlag {\n // Used by admins to flag creators for various reasons\n id Int @id @default(autoincrement())\n label String // reason for flagging (e.g. Scammer)\n comment String? @db.Text // optional comment from admin\n color String // customizable tag color\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n userId Int // user ID of the flagged creator\n user User @relation(\"UserAssignedFlags\", fields: [userId], references: [id])\n\n flaggedByUserId Int // user ID of the admin who flagged the creator\n flaggedByUser User @relation(\"UserCreatedFlags\", fields: [flaggedByUserId], references: [id])\n\n editedByUserId Int? // user ID of the admin who last edited the flag\n editedByUser User? @relation(\"UserEditedFlags\", fields: [editedByUserId], references: [id])\n}\n",
|
|
1587
|
+
"inlineSchemaHash": "294df5cb35eda6e912059e3139efe7c5e5a3a9c25d10aa02df336aa940499c90",
|
|
1584
1588
|
"copyEngine": true
|
|
1585
1589
|
}
|
|
1586
1590
|
config.dirname = '/'
|
package/index.js
CHANGED
|
@@ -1513,7 +1513,7 @@ const config = {
|
|
|
1513
1513
|
"value": "prisma-client-js"
|
|
1514
1514
|
},
|
|
1515
1515
|
"output": {
|
|
1516
|
-
"value": "/home/runner/github-runner-
|
|
1516
|
+
"value": "/home/runner/github-runner-ew1PhVMDrQF2N/creator-database/creator-database/client/creatorco/client",
|
|
1517
1517
|
"fromEnvVar": null
|
|
1518
1518
|
},
|
|
1519
1519
|
"config": {
|
|
@@ -1552,6 +1552,10 @@ const config = {
|
|
|
1552
1552
|
{
|
|
1553
1553
|
"fromEnvVar": null,
|
|
1554
1554
|
"value": "linux-arm64-openssl-1.0.x"
|
|
1555
|
+
},
|
|
1556
|
+
{
|
|
1557
|
+
"fromEnvVar": null,
|
|
1558
|
+
"value": "linux-musl-arm64-openssl-1.1.x"
|
|
1555
1559
|
}
|
|
1556
1560
|
],
|
|
1557
1561
|
"previewFeatures": [
|
|
@@ -1580,8 +1584,8 @@ const config = {
|
|
|
1580
1584
|
}
|
|
1581
1585
|
}
|
|
1582
1586
|
},
|
|
1583
|
-
"inlineSchema": "generator erd {\n provider = \"prisma-erd-generator\"\n includeRelationFromFields = true\n output = \"../../docs/creatorco_erd.md\"\n}\n\ngenerator kysely {\n provider = \"prisma-kysely\"\n output = \"../../client/creatorco/kysely\"\n fileName = \"types.ts\"\n enumFileName = \"enums.ts\"\n readOnlyIds = true\n camelCase = true\n jsonTypeOverride = Json\n}\n\ngenerator client {\n provider = \"prisma-client-js\"\n output = \"../../client/creatorco/client\"\n previewFeatures = [\"fullTextIndex\", \"fullTextSearch\"]\n // macos (arm or x86), native, linux arm64 ssl3.x, windows\n binaryTargets = [\"native\", \"darwin\", \"darwin-arm64\", \"linux-arm64-openssl-3.0.x\", \"windows\", \"debian-openssl-3.0.x\", \"linux-musl-arm64-openssl-3.0.x\", \"linux-arm64-openssl-1.0.x\"]\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_URL\")\n}\n\nmodel User {\n id Int @id @default(autoincrement())\n idmId String? @unique @map(\"idm_id\")\n role String\n email String? @unique\n password String?\n registered DateTime @default(now())\n lastLoginDate DateTime?\n firstName String?\n lastName String?\n phone String?\n phoneCode Int?\n phoneShort String?\n profilePicUrl String? @db.VarChar(2083)\n forgotPasswordKey String? @unique\n affiliateSlug String? @unique\n closed DateTime?\n closedReason String?\n usercomLastSynced DateTime? @default(now())\n extraData Json @default(\"{}\")\n\n referrerId Int?\n\n referrer User? @relation(\"Referrals\", fields: [referrerId], references: [id])\n referredUsers User[] @relation(\"Referrals\")\n logs Log[]\n creatorProfile CreatorProfile?\n instagramProfile InstagramProfile?\n youtubeProfile YoutubeProfile?\n tiktokProfile TiktokProfile?\n facebookProfile FacebookProfile?\n twitterProfile TwitterProfile?\n twitchProfile TwitchProfile?\n brandProfiles BrandUserProfile[]\n optIns OptIn[]\n assignedBrands Brand[]\n messages Message[]\n socialPosts SocialPost[]\n paymentTransactions PaymentTransaction[]\n affiliateLinks AffiliateLink[]\n campaignPins CampaignPin[]\n socialProfiles SocialProfile[]\n rakutenActivity RakutenActivity[]\n impactRadiusEvents ImpactRadiusEvent[]\n cjEvents CjEvent[]\n flagsAssigned CreatorFlag[] @relation(\"UserAssignedFlags\") // flags assigned to the user\n flagsCreated CreatorFlag[] @relation(\"UserCreatedFlags\") // flags created by the user\n flagsEdited CreatorFlag[] @relation(\"UserEditedFlags\") // flags edited by the user\n\n fullName String? @default(dbgenerated())\n phoneNormalised String? @default(dbgenerated())\n\n @@index([phoneCode, phone])\n @@map(\"user\")\n}\n\nmodel Log {\n id Int @id @default(autoincrement())\n\n userId Int?\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n data Json?\n}\n\nmodel CreatorProfile {\n id Int @id @default(autoincrement())\n country String?\n region String?\n birthDate DateTime?\n interests Json? // deprecated\n gender String?\n shippingAddress1 String?\n shippingAddress2 String?\n shippingCity String?\n shippingRegion String?\n shippingCountry String?\n shippingPostcode String?\n phylloUserId String?\n profileSlug String? @unique\n profileSettings Json?\n walletAddress String? @unique\n\n niches CreatorToCategory[]\n\n userId Int @unique\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@index(phylloUserId)\n @@map(\"creatorprofile\")\n}\n\nmodel InstagramProfile {\n id Int @id @default(autoincrement())\n instagramId String?\n\n // fields consistent accross profiles\n username String\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n fullName String? @db.VarChar(1024)\n isBusiness Boolean?\n isPrivate Boolean?\n isVerified Boolean?\n mediaCount Int?\n followingCount Int?\n totalComments Int?\n totalLikes Int?\n avgComments Float?\n avgLikes Float?\n bio String?\n externalUrl String? @db.VarChar(2083)\n hasHighlightReels Boolean?\n category String?\n hasClips Boolean?\n hasGuides Boolean?\n hasChannel Boolean?\n totalIgtvVideos Int?\n profilePicUrlHd String? @db.VarChar(2083) // DEPRECATED\n lastStoriesUpdate DateTime?\n\n extraData Json?\n phylloData Json?\n audienceData Json @default(\"{}\")\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n brandId Int? @unique\n brand Brand? @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@index(username)\n @@index(instagramId)\n @@map(\"instagramprofile\")\n}\n\nmodel TiktokProfile {\n id Int @id @default(autoincrement())\n tiktokId String @unique\n\n // fields consistent accross profiles\n username String?\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n handle String?\n nickname String?\n followingCount Int?\n totalComments Int?\n totalLikes Int?\n\n extraData Json?\n phylloData Json?\n audienceData Json @default(\"{}\")\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n brandId Int? @unique\n brand Brand? @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@index(username)\n @@map(\"tiktokprofile\")\n}\n\nmodel YoutubeProfile {\n id Int @id @default(autoincrement())\n youtubeId String @unique\n\n // fields consistent accross profiles\n username String\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n followingCount Int?\n fullName String? @db.VarChar(1024)\n isVerified Boolean?\n subscribers Int?\n description String? @db.Text\n country String?\n totalViews Int?\n totalVideos Int?\n\n extraData Json?\n phylloData Json?\n audienceData Json @default(\"{}\")\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n brandId Int? @unique\n brand Brand? @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@index(username)\n @@map(\"youtubeprofile\")\n}\n\nmodel TwitchProfile {\n id Int @id @default(autoincrement())\n twitchId String @unique\n\n // fields consistent accross profiles\n username String @unique\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n extraData Json?\n phylloData Json?\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@map(\"twitchprofile\")\n}\n\nmodel FacebookProfile {\n id Int @id @default(autoincrement())\n facebookId String @unique\n\n // fields consistent accross profiles\n username String @unique\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n extraData Json?\n phylloData Json?\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@map(\"facebookprofile\")\n}\n\nmodel TwitterProfile {\n id Int @id @default(autoincrement())\n twitterId String @unique\n\n // fields consistent accross profiles\n username String @unique\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n extraData Json?\n phylloData Json?\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@map(\"twitterprofile\")\n}\n\nmodel BrandUserProfile {\n id Int @id @default(autoincrement())\n userId Int\n brandId Int\n agencyPrivileges Boolean @default(false) @map(\"agency_privileges\")\n\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@index([userId])\n @@index([brandId])\n @@map(\"branduserprofile\")\n}\n\nmodel Brand {\n id Int @id @default(autoincrement())\n name String\n description String? @db.Text\n website String\n monthlyContacts Int?\n monthlyReports Int?\n lastContactDistribution DateTime?\n logoUrl String? @db.VarChar(2083)\n affiliateBaseUrl String? @db.VarChar(2083)\n affiliateCommission Float?\n extraData Json @default(\"{}\")\n\n specialistId Int?\n dedicatedSpecialist User? @relation(fields: [specialistId], references: [id])\n instagramProfile InstagramProfile?\n youtubeProfile YoutubeProfile?\n tiktokProfile TiktokProfile?\n campaigns Campaign[]\n brandUsers BrandUserProfile[]\n searchContacts SearchContacts[]\n reportCredits ReportCredits[]\n categories BrandToCategory[]\n paymentTransactions PaymentTransaction[]\n savedfiles SavedFile[]\n creatorLists CreatorList[]\n affiliateLinks BrandAffiliateLink[]\n messageTemplate MessageTemplate[]\n emailTemplates EmailTemplate[]\n socialListeningLists SocialListeningList[]\n campaignInvites CampaignInvite[]\n images BrandToImage[]\n creatorsearchfilter CreatorSearchFilter[]\n sequences Sequence[]\n impactRadiusEvents ImpactRadiusEvent[]\n cjEvents CjEvent[]\n shopifyStores ShopifyStore[]\n productLists ProductList[]\n\n // for agencies\n parentBrandId Int?\n parentBrand Brand? @relation(\"ChildBrands\", fields: [parentBrandId], references: [id])\n childBrands Brand[] @relation(\"ChildBrands\")\n // generated (for search)\n searchName String? @default(dbgenerated())\n\n @@map(\"brand\")\n}\n\nmodel SearchContacts {\n id Int @id @default(autoincrement())\n type String\n prevQty Float\n changeQty Float\n currentQty Float\n created DateTime? @default(now())\n\n prevQtyPostId Int? @unique\n prevQtyPost SearchContacts? @relation(\"prevSearchQtyPostId\", fields: [prevQtyPostId], references: [id])\n nextQtyPost SearchContacts? @relation(\"prevSearchQtyPostId\")\n\n brandId Int\n brand Brand @relation(fields: [brandId], references: [id])\n\n @@map(\"searchcontacts\")\n}\n\nmodel ReportCredits {\n id Int @id @default(autoincrement())\n type String\n prevQty Float\n changeQty Float\n currentQty Float\n created DateTime? @default(now())\n\n prevQtyPostId Int? @unique\n prevQtyPost ReportCredits? @relation(\"prevReportsQtyPostId\", fields: [prevQtyPostId], references: [id])\n nextQtyPost ReportCredits? @relation(\"prevReportsQtyPostId\")\n\n brandId Int\n brand Brand @relation(fields: [brandId], references: [id])\n\n @@map(\"reportcredits\")\n}\n\nmodel BrandToImage {\n id Int @id @default(autoincrement())\n brandId Int\n type String\n\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n sizes BrandImage[]\n\n @@index([brandId])\n @@map(\"brandtoimage\")\n}\n\nmodel BrandToCategory {\n brandId Int\n categoryId Int\n\n campaign Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n category Category @relation(fields: [categoryId], references: [id])\n\n @@id([brandId, categoryId])\n @@map(\"brandtocategory\")\n}\n\nmodel CreatorToCategory {\n creatorProfileId Int\n categoryId Int\n\n creatorProfile CreatorProfile @relation(fields: [creatorProfileId], references: [id], onDelete: Cascade)\n category Category @relation(fields: [categoryId], references: [id])\n\n @@id([creatorProfileId, categoryId])\n}\n\nmodel Chat {\n id Int @id @default(autoincrement())\n created DateTime? @default(now())\n conversationId String? @unique\n metaData Json @default(\"{}\")\n\n optInId Int? @unique\n\n optIn OptIn? @relation(fields: [optInId], references: [id])\n messages Message[]\n\n @@map(\"chat\")\n}\n\nmodel Message {\n id Int @id @default(autoincrement())\n created DateTime? @default(now())\n sender String\n content String @db.Text\n read Boolean @default(false)\n type String @default(\"text\")\n messageSid String?\n\n userId Int?\n chatId Int\n\n user User? @relation(fields: [userId], references: [id])\n chat Chat @relation(fields: [chatId], references: [id], onDelete: Cascade)\n\n @@index([chatId])\n @@map(\"message\")\n}\n\nmodel Campaign {\n id Int @id @default(autoincrement())\n title String\n slug String? @unique\n status String @default(\"draft\") // draft, paused, pending, private, publish, trash\n date DateTime @default(now())\n publishDate DateTime?\n sfSyncDate DateTime?\n description String? @db.Text\n productDescription String? @db.Text\n prizeDescription String? @db.Text\n strategy String? @default(\"shoutout\")\n socialChannel String?\n socialChannels Json?\n facebookReach Int?\n facebookEngagement Float?\n instagramReach Int?\n instagramEngagement Float?\n youtubeReach Int?\n youtubeEngagement Float?\n twitterReach Int?\n twitterEngagement Float?\n tiktokReach Int?\n tiktokEngagement Float?\n twitchReach Int?\n twitchEngagement Float?\n quantity Int @default(0)\n holdCost Float?\n value Float?\n paidAmount Float?\n minAge Int?\n maxAge Int?\n visuals String? @db.Text\n photoTags Json?\n hashtags Json?\n storyHashtags Json?\n storyMentions Json?\n caption String? @db.Text\n password String?\n contentFormats Json?\n paidCampaign Boolean?\n minPaidAmount Float?\n maxPaidAmount Float?\n paymentType String?\n monthlyActivatedGoal Int? // Redundant/Deprecated\n expectedOptIns Int? // Redundant/Deprecated\n goalActivations Float?\n goalOptIns Float?\n requiresShipping Boolean?\n disableQualifications Boolean?\n disableActivations Boolean?\n affiliateLinkPath String?\n metaData Json @default(\"{}\")\n\n steps CampaignStep[]\n categories CampaignToCategory[]\n optIns OptIn[]\n images CampaignToImage[]\n variables Variable[]\n productLists CampaignToProductList[]\n countries CampaignToCountry[]\n campaignPins CampaignPin[]\n socialPosts SocialPost[]\n campaignInvites CampaignInvite[]\n campaignToShopifyProducts CampaignToShopifyProduct[]\n campaignToBrandAffiliateLinks CampaignToBrandAffiliateLink[]\n linkedPosts CampaignToSocialPost[]\n\n brandId Int\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n creatorLists CreatorList[]\n optInViews OptInView[]\n sequences Sequence[]\n ExternalAffiliateClick ExternalAffiliateClick[]\n\n @@index([brandId])\n @@index([sfSyncDate])\n @@map(\"campaign\")\n}\n\nmodel CampaignPin {\n id Int @id @default(autoincrement())\n userId Int\n campaignId Int\n created DateTime @default(now())\n notified DateTime?\n\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n\n @@index([userId])\n @@map(\"campaignpin\")\n}\n\nmodel CampaignToImage {\n id Int @id @default(autoincrement())\n campaignId Int\n type String\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n\n sizes Image[]\n\n @@map(\"campaigntoimage\")\n}\n\nmodel CampaignToBrandAffiliateLink {\n campaignId Int\n brandAffiliateLinkId Int\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n brandAffiliateLink BrandAffiliateLink @relation(fields: [brandAffiliateLinkId], references: [id], onDelete: Cascade)\n\n @@id([campaignId, brandAffiliateLinkId])\n @@index([brandAffiliateLinkId])\n @@map(\"campaigntobrandaffiliatelink\")\n}\n\nmodel CampaignToCategory {\n campaignId Int\n categoryId Int\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n category Category @relation(fields: [categoryId], references: [id])\n\n @@id([campaignId, categoryId])\n @@map(\"campaigntocategory\")\n}\n\nmodel CampaignToCountry {\n campaignId Int\n countryId Int\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n country Country @relation(fields: [countryId], references: [id])\n\n @@id([campaignId, countryId])\n @@map(\"campaigntocountry\")\n}\n\nmodel ProductList {\n id Int @id @default(autoincrement())\n title String\n description String? @db.Text\n metaData Json @default(\"{}\")\n deactivated DateTime?\n\n brandId Int\n\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n items ProductListItem[]\n campaignProductLists CampaignToProductList[]\n\n @@index([brandId])\n @@map(\"product_list\")\n}\n\nmodel ProductListItem {\n id Int @id @default(autoincrement())\n title String\n description String? @db.Text\n metaData Json @default(\"{}\")\n deactivated DateTime?\n\n productListId Int\n productList ProductList @relation(fields: [productListId], references: [id], onDelete: Cascade)\n optins OptinToProductListItem[]\n\n @@index([productListId])\n @@map(\"product_list_item\")\n}\n\nmodel CampaignToProductList {\n campaignId Int\n productListId Int\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n productList ProductList @relation(fields: [productListId], references: [id])\n\n @@id([campaignId, productListId])\n @@index([productListId])\n @@map(\"campaign_to_product_list\")\n}\n\nmodel OptinToProductListItem {\n optInId Int\n productListItemId Int\n\n optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)\n productListItem ProductListItem @relation(fields: [productListItemId], references: [id], onDelete: Cascade)\n\n @@id([optInId, productListItemId])\n @@index([productListItemId])\n @@map(\"optin_to_product_list_item\")\n}\n\nmodel Variable {\n id Int @id @default(autoincrement())\n title String\n description String? @db.Text\n metaData Json @default(\"{}\")\n\n campaignId Int\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n\n options VariableOption[]\n optInVariables OptInVariable[]\n}\n\nmodel VariableOption {\n id Int @id @default(autoincrement())\n title String\n description String? @db.Text\n metaData Json @default(\"{}\")\n\n variableId Int\n\n variable Variable @relation(fields: [variableId], references: [id], onDelete: Cascade)\n\n optInVariables OptInVariable[]\n}\n\nmodel Step {\n id Int @id @default(autoincrement())\n slug String @unique\n title String?\n description String? @db.Text\n data Json?\n\n campaignSteps CampaignStep[]\n\n @@map(\"step\")\n}\n\nmodel CampaignStep {\n id Int @id @default(autoincrement())\n placement Int\n stepSettings Json?\n actionee String?\n instructions String? @db.Text\n customStepTitle String?\n customForm Json?\n metaData Json @default(\"{}\")\n campaignId Int\n stepId Int?\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n step Step? @relation(fields: [stepId], references: [id])\n currentOptIns OptIn[]\n\n optInSteps OptInStep[]\n\n @@index([campaignId])\n @@map(\"campaignstep\")\n}\n\nmodel OptInStep {\n id Int @id @default(autoincrement())\n completed DateTime?\n data Json?\n\n optInId Int\n campaignStepId Int\n socialPostId Int? // temporary for moving shoutoutData to socialPosts\n\n optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)\n campaignStep CampaignStep @relation(fields: [campaignStepId], references: [id], onDelete: Cascade)\n\n @@index([optInId])\n @@index([campaignStepId])\n @@map(\"optinstep\")\n}\n\nmodel Category {\n id Int @id @default(autoincrement())\n slug String @unique\n title String\n\n campaigns CampaignToCategory[]\n brands BrandToCategory[]\n creators CreatorToCategory[]\n\n @@map(\"category\")\n}\n\nmodel OptIn {\n id Int @id @default(autoincrement())\n status String @default(\"pending\")\n created DateTime @default(now())\n activated DateTime?\n completed DateTime?\n cancelled DateTime?\n cancelledData Json @default(\"{}\")\n cancelRequested DateTime?\n reinvited DateTime?\n seen Boolean @default(false)\n instructions String? @db.Text\n paymentAmount Float?\n paymentStatus String @default(\"pending\") // depracated -- refer to trolley payment table\n extraData Json @default(\"{}\")\n favoritedDate DateTime?\n rating Json?\n\n userId Int\n campaignId Int\n currentStepId Int?\n\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n currentStep CampaignStep? @relation(fields: [currentStepId], references: [id])\n\n variables OptInVariable[]\n optInSteps OptInStep[]\n chat Chat?\n campaignInvites CampaignInvite[]\n trolleyPayments TrolleyPayment[]\n affiliateClicks AffiliateClick[]\n productListItems OptinToProductListItem[]\n ExternalAffiliateClick ExternalAffiliateClick[]\n ImpactRadiusEvent ImpactRadiusEvent[]\n CjEvent CjEvent[]\n ShareASaleEvents ShareASaleEvent[]\n shopifyDiscountCodes ShopifyDiscountCode[]\n\n @@index([userId])\n @@index([campaignId])\n @@map(\"optin\")\n}\n\nmodel TrolleyPayment {\n id Int @id @default(autoincrement())\n paymentId String @unique\n type trolleyPaymentType?\n status trolleyPaymentStatus\n optInId Int?\n paymentAmount Int\n metaData Json @default(\"{}\")\n\n optIn OptIn? @relation(fields: [optInId], references: [id])\n}\n\nenum trolleyPaymentType {\n optIn\n tip\n affiliate\n}\n\nenum trolleyPaymentStatus {\n pending\n processing\n processed\n failed\n returned\n}\n\nmodel OptInVariable {\n id Int @id @default(autoincrement())\n\n optInId Int\n variableId Int\n selectedOptionId Int\n\n optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)\n variable Variable @relation(fields: [variableId], references: [id], onDelete: Cascade)\n selectedOption VariableOption @relation(fields: [selectedOptionId], references: [id], onDelete: Cascade)\n\n @@index([optInId])\n}\n\nmodel SocialPost {\n id Int @id @default(autoincrement())\n externalId String @map(\"external_id\")\n phylloId String? @unique\n metaData Json @default(\"{}\")\n lastFetched DateTime?\n lastWebhook DateTime?\n\n // BASIC INFO\n posted DateTime?\n title String? @db.Text\n description String? @db.Text\n url String? @db.VarChar(2083)\n format String?\n type String?\n platform String?\n visibility String?\n isSponsored Boolean?\n hasCollaborators Boolean?\n isOwnedByUser Boolean?\n // METRICS\n views Int?\n replays Int?\n impressions Int?\n impressionsOrganic Int?\n impressionsPaid Int?\n reach Int?\n reachOrganic Int?\n reachPaid Int?\n watchHours Float?\n // ENGAGEMENT METRICS\n likes Int?\n dislikes Int?\n comments Int?\n saves Int?\n shares Int?\n\n userId Int?\n campaignId Int?\n\n user User? @relation(fields: [userId], references: [id])\n campaign Campaign? @relation(fields: [campaignId], references: [id])\n lists ListToSocialPost[]\n campaigns CampaignToSocialPost[]\n\n @@unique([platform, externalId])\n @@index(campaignId)\n @@index(userId)\n @@index(posted)\n @@map(\"socialpost\")\n}\n\nenum CampaignToSocialPostStatus {\n pending\n approved\n declined\n}\n\nmodel CampaignToSocialPost {\n campaignId Int @map(\"campaign_id\")\n socialPostId Int @map(\"social_post_id\")\n\n status CampaignToSocialPostStatus @default(pending)\n created DateTime @default(now())\n metaData Json @default(\"{}\")\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n socialPost SocialPost @relation(fields: [socialPostId], references: [id], onDelete: Cascade)\n\n @@id([campaignId, socialPostId])\n @@index(status)\n @@map(\"campaign_to_social_post\")\n}\n\n// Table for storing archived socialposts from before external_id was implemented\nmodel ArchivedSocialPost {\n id Int @id @default(autoincrement())\n phylloId String? @unique\n metaData Json @default(\"{}\")\n lastFetched DateTime?\n lastWebhook DateTime?\n\n // BASIC INFO\n posted DateTime?\n title String? @db.Text\n description String? @db.Text\n url String? @db.VarChar(2083)\n urlPath String? @unique // DEPRECATED: This is here so we have some external identifier to quickly search by\n format String?\n type String?\n platform String?\n visibility String?\n isSponsored Boolean?\n hasCollaborators Boolean?\n isOwnedByUser Boolean?\n // METRICS\n views Int?\n impressions Int?\n impressionsOrganic Int?\n impressionsPaid Int?\n reach Int?\n reachOrganic Int?\n reachPaid Int?\n watchHours Float?\n // ENGAGEMENT METRICS\n likes Int?\n dislikes Int?\n comments Int?\n saves Int?\n shares Int?\n\n userId Int?\n campaignId Int?\n\n @@map(\"archived_social_post\")\n}\n\nmodel Image {\n id Int @id @default(autoincrement())\n url String @db.VarChar(2083)\n size String\n campaignImageId Int\n\n campaignImage CampaignToImage @relation(fields: [campaignImageId], references: [id], onDelete: Cascade)\n\n @@map(\"image\")\n}\n\nmodel BrandImage {\n id Int @id @default(autoincrement())\n url String @db.VarChar(2083)\n size String\n brandImageId Int\n\n brandImage BrandToImage @relation(fields: [brandImageId], references: [id], onDelete: Cascade)\n\n @@index([brandImageId])\n @@map(\"brandimage\")\n}\n\nmodel Country {\n id Int @id @default(autoincrement())\n countryCode String @unique @db.VarChar(2)\n countryName String @db.VarChar(500)\n teleCode String @db.VarChar(10)\n states State[]\n\n campaigns CampaignToCountry[]\n\n @@map(\"country\")\n}\n\nmodel State {\n id Int @id @default(autoincrement())\n countryId Int\n stateCode String @db.VarChar(50)\n stateName String @db.VarChar(500)\n\n country Country @relation(fields: [countryId], references: [id])\n\n @@map(\"state\")\n}\n\nmodel PaymentTransaction {\n id Int @id @default(autoincrement())\n amount Float\n balance Float\n type String\n date DateTime @default(now())\n notes String? @db.Text\n metaData Json @default(\"{}\")\n accountId Int\n\n brandId Int?\n creatorId Int?\n prevTransactionId Int? @unique\n\n brand Brand? @relation(fields: [brandId], references: [id])\n creator User? @relation(fields: [creatorId], references: [id])\n prevTransaction PaymentTransaction? @relation(\"TransactionHistory\", fields: [prevTransactionId], references: [id])\n nextTransaction PaymentTransaction? @relation(\"TransactionHistory\")\n\n @@index([accountId])\n}\n\nmodel ExternalAffiliateClick {\n id Int @id @default(autoincrement())\n program String\n created DateTime @default(now())\n ipv4 String?\n ipv6 String?\n linkUrl String\n metaData Json @default(\"{}\")\n\n optInId Int\n campaignId Int\n\n optin OptIn @relation(fields: [optInId], references: [id])\n campaign Campaign @relation(fields: [campaignId], references: [id])\n\n @@index([optInId])\n @@map(\"external_affiliate_click\")\n}\n\nmodel BrandAffiliateLink {\n id Int @id @default(autoincrement())\n created DateTime @default(now())\n description String?\n urlPath String\n commission Float @default(0.2)\n metaData Json @default(\"{}\")\n\n brandId Int\n affiliateLinks AffiliateLink[]\n campaignToBrandAffiliateLink CampaignToBrandAffiliateLink[]\n\n brand Brand @relation(fields: [brandId], references: [id])\n\n @@index([brandId])\n}\n\nmodel AffiliateLink {\n id Int @id @default(autoincrement())\n created DateTime @default(now())\n metaData Json @default(\"{}\")\n\n userId Int\n brandAffiliateLinkId Int\n affiliateClicks AffiliateClick[]\n\n affiliate User @relation(fields: [userId], references: [id])\n brandAffiliateLink BrandAffiliateLink @relation(fields: [brandAffiliateLinkId], references: [id])\n}\n\nmodel AffiliateClick {\n id Int @id @default(autoincrement())\n created DateTime @default(now())\n // visitorIp === IPv4\n visitorIp String?\n IPv6 String?\n optInId Int\n metaData Json @default(\"{}\")\n\n affiliateLinkId Int\n\n optin OptIn @relation(fields: [optInId], references: [id])\n affiliateLink AffiliateLink @relation(fields: [affiliateLinkId], references: [id])\n affiliateEvent AffiliateEvent[]\n}\n\nmodel AffiliateEvent {\n id Int @id @default(autoincrement())\n event String // click, purchase, etc.\n created DateTime @default(now())\n visitorIp String?\n urlPath String?\n revenue Float?\n commissionAmount Float?\n commissionPercent Float?\n metaData Json @default(\"{}\")\n\n affiliateClickId Int\n\n affiliateClick AffiliateClick? @relation(fields: [affiliateClickId], references: [id])\n}\n\nmodel SavedFile {\n id Int @id @default(autoincrement())\n title String?\n type String? // audience-report, search-export, campaign-invite\n url String?\n savedDate DateTime?\n metaData Json? @default(\"{}\")\n\n brandId Int?\n brand Brand? @relation(fields: [brandId], references: [id])\n\n @@map(\"savedfile\")\n}\n\nmodel CampaignInvite {\n id Int @id @default(autoincrement())\n socialProfileId Int?\n brandId Int\n campaignId Int?\n optInId Int? @unique\n code String? @unique\n createdAt DateTime @default(now())\n declineDate DateTime?\n declineReason String? @db.Text\n\n metaData Json? @default(\"{}\")\n\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n campaign Campaign? @relation(fields: [campaignId], references: [id])\n socialProfile SocialProfile? @relation(fields: [socialProfileId], references: [id])\n optIn OptIn? @relation(fields: [optInId], references: [id])\n\n @@index([socialProfileId])\n}\n\nmodel CreatorList {\n id Int @id @default(autoincrement())\n brandId Int\n campaignId Int?\n created DateTime @default(now())\n archived DateTime?\n title String\n metaData Json? @default(\"{}\")\n\n creators CreatorListItem[]\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n campaign Campaign? @relation(fields: [campaignId], references: [id])\n sequences Sequence[]\n\n @@index([brandId])\n @@map(\"creatorlist\")\n}\n\nmodel CreatorListItem {\n id Int @id @default(autoincrement())\n socialProfileId Int\n creatorListId Int\n\n saved DateTime @default(now())\n invited DateTime?\n tags Json?\n feedback String? @db.Text\n archived DateTime?\n metaData Json? @default(\"{}\")\n\n creatorList CreatorList @relation(fields: [creatorListId], references: [id], onDelete: Cascade)\n socialProfile SocialProfile? @relation(fields: [socialProfileId], references: [id], onDelete: Cascade)\n\n sequenceOutboundEmails SequenceOutboundEmail[]\n sequenceInboundEmails SequenceInboundEmail[]\n sequenceImapCheckpoints SequenceImapCheckpoint[]\n\n @@index([creatorListId])\n @@map(\"creatorlistitem\")\n}\n\nmodel SocialProfile {\n id Int @id @default(autoincrement())\n socialId String? @unique // need to make sure this can never overlap across multiple platforms, we should append the platform to the beginning to ensure it’s always unique\n userId Int? // registered user id, if available\n\n // social data\n platform String\n username String\n fullname String? @db.VarChar(1024)\n profileUrl String?\n profilePicUrl String? @db.VarChar(2083) // need to specify length, default size is too small\n followerCount Int?\n engagement Float?\n avgViews Int?\n verified Boolean?\n visibility String @default(\"public\")\n metaData Json @default(\"{}\")\n audienceData Json @default(\"{}\")\n phylloData Json @default(\"{}\")\n\n created DateTime @default(now())\n updated DateTime?\n\n creatorListItems CreatorListItem[]\n campaignInvites CampaignInvite[]\n user User? @relation(fields: [userId], references: [id])\n\n @@index(username)\n @@index(userId)\n @@map(\"socialprofile\")\n}\n\nmodel MessageTemplate {\n id Int @id @default(autoincrement())\n label String?\n template String @db.Text\n brandId Int?\n brand Brand? @relation(fields: [brandId], references: [id])\n metaData Json @default(\"{}\") // to save any additional data such as user defined variables\n\n @@index([brandId])\n @@map(\"messagetemplate\")\n}\n\nmodel EmailTemplate {\n id Int @id @default(autoincrement())\n label String?\n subject String?\n template String @db.Text\n brandId Int?\n\n brand Brand? @relation(fields: [brandId], references: [id])\n metaData Json @default(\"{}\") // to save any additional data such as user defined variables\n\n sequenceSteps SequenceStep[]\n\n @@index([brandId])\n}\n\nmodel SocialListeningList {\n id Int @id @default(autoincrement())\n brandId Int\n campaignId Int? @unique // optionally linked to a campaign\n created DateTime @default(now())\n updated DateTime?\n title String\n postType String // sponsored posts, top posts, or recent posts\n filters Json? @default(\"{}\") // filters to search posts by (location, date, hashtags, mentions, etc.)\n\n lastFetched DateTime? // last time posts were fetched\n\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n posts ListToSocialPost[]\n\n @@map(\"sociallisteninglist\")\n}\n\nmodel ListToSocialPost {\n id Int @id @default(autoincrement())\n listId Int\n postId Int\n\n list SocialListeningList @relation(fields: [listId], references: [id], onDelete: Cascade)\n socialPost SocialPost @relation(fields: [postId], references: [id], onDelete: Cascade)\n\n @@index([listId, postId])\n @@index([postId])\n @@map(\"listtosocialpost\")\n}\n\nmodel OptInView {\n id Int @id @default(autoincrement())\n title String\n filters Json @default(\"{}\")\n\n campaignId Int?\n campaign Campaign? @relation(fields: [campaignId], references: [id])\n\n @@map(\"optinview\")\n}\n\nmodel RakutenActivity {\n id Int @id @default(autoincrement())\n orderId String?\n metaData Json @default(\"{}\")\n created DateTime @default(now())\n clicks Int?\n orders Int?\n sales Float?\n commission Float?\n advertiserId Int?\n\n userId Int\n\n user User @relation(fields: [userId], references: [id])\n\n @@map(\"rakutenactivity\")\n}\n\nmodel ImpactRadiusEvent {\n id Int @id @default(autoincrement())\n type String // action/click\n created DateTime @default(now())\n amount Float?\n commission Float?\n metaData Json @default(\"{}\")\n\n userId Int\n brandId Int?\n optInId Int?\n\n user User @relation(fields: [userId], references: [id])\n brand Brand? @relation(fields: [brandId], references: [id])\n optIn OptIn? @relation(fields: [optInId], references: [id])\n}\n\nmodel CjEvent {\n id Int @id @default(autoincrement())\n type String // action/click\n created DateTime @default(now())\n amount Float?\n commission Float?\n metaData Json @default(\"{}\")\n\n userId Int\n brandId Int?\n optInId Int?\n\n user User @relation(fields: [userId], references: [id])\n brand Brand? @relation(fields: [brandId], references: [id])\n optIn OptIn? @relation(fields: [optInId], references: [id])\n\n @@map(\"cjevent\")\n}\n\nmodel ShareASaleEvent {\n id Int @id @default(autoincrement())\n transactionId String? @unique @map(\"transaction_id\")\n created DateTime @default(now())\n saleAmount Decimal? @map(\"sale_amount\") @db.Decimal(9, 2)\n commission Decimal? @db.Decimal(9, 2)\n metaData Json @default(\"{}\") @map(\"meta_data\")\n\n optInId Int? @map(\"optin_id\")\n\n optIn OptIn? @relation(fields: [optInId], references: [id])\n\n @@map(\"shareasale_event\")\n}\n\nmodel CreatorSearchFilter {\n id Int @id @default(autoincrement())\n brandId Int\n title String\n filters Json @default(\"{}\")\n createdAt DateTime @default(now())\n updatedAt DateTime?\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@map(\"creatorsearchfilter\")\n}\n\nmodel Sequence {\n id Int @id @default(autoincrement())\n campaignId Int\n creatorListId Int\n title String @db.VarChar(255)\n createdAt DateTime @default(now())\n completed Boolean @default(false)\n brandId Int\n enabled Boolean @default(false)\n\n campaign Campaign @relation(fields: [campaignId], references: [id])\n creatorList CreatorList @relation(fields: [creatorListId], references: [id])\n brand Brand @relation(fields: [brandId], references: [id])\n\n steps SequenceStep[]\n outboundEmails SequenceOutboundEmail[]\n inboundEmails SequenceInboundEmail[]\n imapCheckpoints SequenceImapCheckpoint[]\n\n @@map(\"sequence\")\n}\n\nmodel SequenceStep {\n id Int @id @default(autoincrement())\n sequenceId Int\n createdAt DateTime @default(now())\n emailTemplateId Int\n daysAfterPrevious Int\n order Int\n stepId Int\n\n sequence Sequence @relation(fields: [sequenceId], references: [id], onDelete: Cascade)\n emailTemplate EmailTemplate @relation(fields: [emailTemplateId], references: [id])\n\n outboundEmails SequenceOutboundEmail[]\n\n @@map(\"sequencestep\")\n}\n\nmodel SequenceOutboundEmail {\n id Int @id @default(autoincrement())\n sequenceId Int\n creatorListItemId Int\n sequenceStepId Int\n sentAt DateTime @default(now())\n\n sequence Sequence @relation(fields: [sequenceId], references: [id])\n creatorList CreatorListItem @relation(fields: [creatorListItemId], references: [id])\n sequenceStep SequenceStep @relation(fields: [sequenceStepId], references: [id])\n\n @@map(\"sequenceoutboundemail\")\n}\n\nmodel SequenceInboundEmail {\n id Int @id @default(autoincrement())\n sequenceId Int\n creatorListItemId Int\n receivedAt DateTime @default(now())\n msgHash String\n\n sequence Sequence @relation(fields: [sequenceId], references: [id])\n creatorListId CreatorListItem @relation(fields: [creatorListItemId], references: [id])\n\n @@map(\"sequenceinboundemail\")\n}\n\nmodel SequenceImapCheckpoint {\n sequenceId Int\n creatorListItemId Int\n lastReadMsgDate DateTime @default(now())\n createdAt DateTime @default(now())\n updatedAt DateTime @default(now())\n\n sequence Sequence @relation(fields: [sequenceId], references: [id])\n creatorListId CreatorListItem @relation(fields: [creatorListItemId], references: [id])\n\n @@id([sequenceId, creatorListItemId])\n @@map(\"sequenceimapcheckpoint\")\n}\n\nmodel ShopifyStore {\n id Int @id @default(autoincrement())\n name String?\n url String\n accessToken String? @map(\"access_token\")\n syncStatus ShopifyStoreSyncStatus @default(syncing) @map(\"sync_status\")\n lastSynced DateTime? @map(\"last_synced\")\n metaData Json @default(\"{}\") @map(\"meta_data\")\n\n brandId Int @map(\"brand_id\")\n\n products ShopifyProduct[]\n\n brand Brand? @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@index([brandId])\n @@map(\"shopify_store\")\n}\n\nenum ShopifyStoreSyncStatus {\n syncing\n synced\n error\n}\n\nmodel ShopifyProduct {\n id Int @id @default(autoincrement())\n shopifyId String @unique @map(\"shopify_id\")\n title String\n handle String\n imageUrl String @map(\"image_url\") @db.Text\n\n metaData Json @default(\"{}\") @map(\"meta_data\")\n\n shopifyStoreId Int @map(\"shopify_store_id\")\n\n campaignToShopifyProducts CampaignToShopifyProduct[]\n variations ShopifyProductVariation[]\n\n shopifyStore ShopifyStore @relation(fields: [shopifyStoreId], references: [id], onDelete: Cascade)\n\n @@map(\"shopify_product\")\n}\n\nmodel ShopifyProductVariation {\n id Int @id @default(autoincrement())\n shopifyId String @unique @map(\"shopify_id\")\n title String\n imageUrl String @map(\"image_url\") @db.Text\n\n metaData Json @default(\"{}\") @map(\"meta_data\")\n\n shopifyProductId Int @map(\"shopify_product_id\")\n\n shopifyProduct ShopifyProduct @relation(fields: [shopifyProductId], references: [id], onDelete: Cascade)\n\n @@map(\"shopify_product_variation\")\n}\n\nmodel CampaignToShopifyProduct {\n campaignId Int @map(\"campaign_id\")\n shopifyProductId Int @map(\"shopify_product_id\")\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n shopifyProduct ShopifyProduct @relation(fields: [shopifyProductId], references: [id], onDelete: Cascade)\n\n @@id([campaignId, shopifyProductId])\n @@map(\"campaign_to_shopify_product\")\n}\n\nmodel ShopifyDiscountCode {\n id Int @id @default(autoincrement())\n code String @unique\n shopifyDiscountCodeId Int? @unique @map(\"shopify_discount_code_id\")\n shopifyPriceRuleId BigInt? @map(\"price_rule_id\")\n\n optInId Int @map(\"optin_id\")\n\n optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)\n\n shopifySales ShopifySale[]\n\n @@map(\"shopify_discount_code\")\n}\n\nmodel ShopifySale {\n id Int @id @default(autoincrement())\n amount Float\n metaData Json? @map(\"meta_data\")\n discountCodeId Int @map(\"discount_code_id\")\n created DateTime @default(now())\n\n discountCode ShopifyDiscountCode @relation(fields: [discountCodeId], references: [id], onDelete: Cascade)\n\n @@map(\"shopify_sale\")\n}\n\nmodel CreatorFlag {\n // Used by admins to flag creators for various reasons\n id Int @id @default(autoincrement())\n label String // reason for flagging (e.g. Scammer)\n comment String? @db.Text // optional comment from admin\n color String // customizable tag color\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n userId Int // user ID of the flagged creator\n user User @relation(\"UserAssignedFlags\", fields: [userId], references: [id])\n\n flaggedByUserId Int // user ID of the admin who flagged the creator\n flaggedByUser User @relation(\"UserCreatedFlags\", fields: [flaggedByUserId], references: [id])\n\n editedByUserId Int? // user ID of the admin who last edited the flag\n editedByUser User? @relation(\"UserEditedFlags\", fields: [editedByUserId], references: [id])\n}\n",
|
|
1584
|
-
"inlineSchemaHash": "
|
|
1587
|
+
"inlineSchema": "generator erd {\n provider = \"prisma-erd-generator\"\n includeRelationFromFields = true\n output = \"../../docs/creatorco_erd.md\"\n}\n\ngenerator kysely {\n provider = \"prisma-kysely\"\n output = \"../../client/creatorco/kysely\"\n fileName = \"types.ts\"\n enumFileName = \"enums.ts\"\n readOnlyIds = true\n camelCase = true\n jsonTypeOverride = Json\n}\n\ngenerator client {\n provider = \"prisma-client-js\"\n output = \"../../client/creatorco/client\"\n previewFeatures = [\"fullTextIndex\", \"fullTextSearch\"]\n // macos (arm or x86), native, linux arm64 ssl3.x, windows\n binaryTargets = [\"native\", \"darwin\", \"darwin-arm64\", \"linux-arm64-openssl-3.0.x\", \"windows\", \"debian-openssl-3.0.x\", \"linux-musl-arm64-openssl-3.0.x\", \"linux-arm64-openssl-1.0.x\", \"linux-musl-arm64-openssl-1.1.x\"]\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_URL\")\n}\n\nmodel User {\n id Int @id @default(autoincrement())\n idmId String? @unique @map(\"idm_id\")\n role String\n email String? @unique\n password String?\n registered DateTime @default(now())\n lastLoginDate DateTime?\n firstName String?\n lastName String?\n phone String?\n phoneCode Int?\n phoneShort String?\n profilePicUrl String? @db.VarChar(2083)\n forgotPasswordKey String? @unique\n affiliateSlug String? @unique\n closed DateTime?\n closedReason String?\n usercomLastSynced DateTime? @default(now())\n extraData Json @default(\"{}\")\n\n referrerId Int?\n\n referrer User? @relation(\"Referrals\", fields: [referrerId], references: [id])\n referredUsers User[] @relation(\"Referrals\")\n logs Log[]\n creatorProfile CreatorProfile?\n instagramProfile InstagramProfile?\n youtubeProfile YoutubeProfile?\n tiktokProfile TiktokProfile?\n facebookProfile FacebookProfile?\n twitterProfile TwitterProfile?\n twitchProfile TwitchProfile?\n brandProfiles BrandUserProfile[]\n optIns OptIn[]\n assignedBrands Brand[]\n messages Message[]\n socialPosts SocialPost[]\n paymentTransactions PaymentTransaction[]\n affiliateLinks AffiliateLink[]\n campaignPins CampaignPin[]\n socialProfiles SocialProfile[]\n rakutenActivity RakutenActivity[]\n impactRadiusEvents ImpactRadiusEvent[]\n cjEvents CjEvent[]\n flagsAssigned CreatorFlag[] @relation(\"UserAssignedFlags\") // flags assigned to the user\n flagsCreated CreatorFlag[] @relation(\"UserCreatedFlags\") // flags created by the user\n flagsEdited CreatorFlag[] @relation(\"UserEditedFlags\") // flags edited by the user\n\n fullName String? @default(dbgenerated())\n phoneNormalised String? @default(dbgenerated())\n\n @@index([phoneCode, phone])\n @@map(\"user\")\n}\n\nmodel Log {\n id Int @id @default(autoincrement())\n\n userId Int?\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n data Json?\n}\n\nmodel CreatorProfile {\n id Int @id @default(autoincrement())\n country String?\n region String?\n birthDate DateTime?\n interests Json? // deprecated\n gender String?\n shippingAddress1 String?\n shippingAddress2 String?\n shippingCity String?\n shippingRegion String?\n shippingCountry String?\n shippingPostcode String?\n phylloUserId String?\n profileSlug String? @unique\n profileSettings Json?\n walletAddress String? @unique\n\n niches CreatorToCategory[]\n\n userId Int @unique\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@index(phylloUserId)\n @@map(\"creatorprofile\")\n}\n\nmodel InstagramProfile {\n id Int @id @default(autoincrement())\n instagramId String?\n\n // fields consistent accross profiles\n username String\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n fullName String? @db.VarChar(1024)\n isBusiness Boolean?\n isPrivate Boolean?\n isVerified Boolean?\n mediaCount Int?\n followingCount Int?\n totalComments Int?\n totalLikes Int?\n avgComments Float?\n avgLikes Float?\n bio String?\n externalUrl String? @db.VarChar(2083)\n hasHighlightReels Boolean?\n category String?\n hasClips Boolean?\n hasGuides Boolean?\n hasChannel Boolean?\n totalIgtvVideos Int?\n profilePicUrlHd String? @db.VarChar(2083) // DEPRECATED\n lastStoriesUpdate DateTime?\n\n extraData Json?\n phylloData Json?\n audienceData Json @default(\"{}\")\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n brandId Int? @unique\n brand Brand? @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@index(username)\n @@index(instagramId)\n @@map(\"instagramprofile\")\n}\n\nmodel TiktokProfile {\n id Int @id @default(autoincrement())\n tiktokId String @unique\n\n // fields consistent accross profiles\n username String?\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n handle String?\n nickname String?\n followingCount Int?\n totalComments Int?\n totalLikes Int?\n\n extraData Json?\n phylloData Json?\n audienceData Json @default(\"{}\")\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n brandId Int? @unique\n brand Brand? @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@index(username)\n @@map(\"tiktokprofile\")\n}\n\nmodel YoutubeProfile {\n id Int @id @default(autoincrement())\n youtubeId String @unique\n\n // fields consistent accross profiles\n username String\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n followingCount Int?\n fullName String? @db.VarChar(1024)\n isVerified Boolean?\n subscribers Int?\n description String? @db.Text\n country String?\n totalViews Int?\n totalVideos Int?\n\n extraData Json?\n phylloData Json?\n audienceData Json @default(\"{}\")\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n brandId Int? @unique\n brand Brand? @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@index(username)\n @@map(\"youtubeprofile\")\n}\n\nmodel TwitchProfile {\n id Int @id @default(autoincrement())\n twitchId String @unique\n\n // fields consistent accross profiles\n username String @unique\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n extraData Json?\n phylloData Json?\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@map(\"twitchprofile\")\n}\n\nmodel FacebookProfile {\n id Int @id @default(autoincrement())\n facebookId String @unique\n\n // fields consistent accross profiles\n username String @unique\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n extraData Json?\n phylloData Json?\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@map(\"facebookprofile\")\n}\n\nmodel TwitterProfile {\n id Int @id @default(autoincrement())\n twitterId String @unique\n\n // fields consistent accross profiles\n username String @unique\n url String? @db.VarChar(2083)\n profilePicUrl String? @db.VarChar(2083)\n followerCount Int?\n engagement Float?\n lastUpdated DateTime?\n\n extraData Json?\n phylloData Json?\n visibility String? @default(\"public\")\n\n userId Int? @unique\n user User? @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@map(\"twitterprofile\")\n}\n\nmodel BrandUserProfile {\n id Int @id @default(autoincrement())\n userId Int\n brandId Int\n agencyPrivileges Boolean @default(false) @map(\"agency_privileges\")\n\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@index([userId])\n @@index([brandId])\n @@map(\"branduserprofile\")\n}\n\nmodel Brand {\n id Int @id @default(autoincrement())\n name String\n description String? @db.Text\n website String\n monthlyContacts Int?\n monthlyReports Int?\n lastContactDistribution DateTime?\n logoUrl String? @db.VarChar(2083)\n affiliateBaseUrl String? @db.VarChar(2083)\n affiliateCommission Float?\n extraData Json @default(\"{}\")\n\n specialistId Int?\n dedicatedSpecialist User? @relation(fields: [specialistId], references: [id])\n instagramProfile InstagramProfile?\n youtubeProfile YoutubeProfile?\n tiktokProfile TiktokProfile?\n campaigns Campaign[]\n brandUsers BrandUserProfile[]\n searchContacts SearchContacts[]\n reportCredits ReportCredits[]\n categories BrandToCategory[]\n paymentTransactions PaymentTransaction[]\n savedfiles SavedFile[]\n creatorLists CreatorList[]\n affiliateLinks BrandAffiliateLink[]\n messageTemplate MessageTemplate[]\n emailTemplates EmailTemplate[]\n socialListeningLists SocialListeningList[]\n campaignInvites CampaignInvite[]\n images BrandToImage[]\n creatorsearchfilter CreatorSearchFilter[]\n sequences Sequence[]\n impactRadiusEvents ImpactRadiusEvent[]\n cjEvents CjEvent[]\n shopifyStores ShopifyStore[]\n productLists ProductList[]\n\n // for agencies\n parentBrandId Int?\n parentBrand Brand? @relation(\"ChildBrands\", fields: [parentBrandId], references: [id])\n childBrands Brand[] @relation(\"ChildBrands\")\n // generated (for search)\n searchName String? @default(dbgenerated())\n\n @@map(\"brand\")\n}\n\nmodel SearchContacts {\n id Int @id @default(autoincrement())\n type String\n prevQty Float\n changeQty Float\n currentQty Float\n created DateTime? @default(now())\n\n prevQtyPostId Int? @unique\n prevQtyPost SearchContacts? @relation(\"prevSearchQtyPostId\", fields: [prevQtyPostId], references: [id])\n nextQtyPost SearchContacts? @relation(\"prevSearchQtyPostId\")\n\n brandId Int\n brand Brand @relation(fields: [brandId], references: [id])\n\n @@map(\"searchcontacts\")\n}\n\nmodel ReportCredits {\n id Int @id @default(autoincrement())\n type String\n prevQty Float\n changeQty Float\n currentQty Float\n created DateTime? @default(now())\n\n prevQtyPostId Int? @unique\n prevQtyPost ReportCredits? @relation(\"prevReportsQtyPostId\", fields: [prevQtyPostId], references: [id])\n nextQtyPost ReportCredits? @relation(\"prevReportsQtyPostId\")\n\n brandId Int\n brand Brand @relation(fields: [brandId], references: [id])\n\n @@map(\"reportcredits\")\n}\n\nmodel BrandToImage {\n id Int @id @default(autoincrement())\n brandId Int\n type String\n\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n sizes BrandImage[]\n\n @@index([brandId])\n @@map(\"brandtoimage\")\n}\n\nmodel BrandToCategory {\n brandId Int\n categoryId Int\n\n campaign Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n category Category @relation(fields: [categoryId], references: [id])\n\n @@id([brandId, categoryId])\n @@map(\"brandtocategory\")\n}\n\nmodel CreatorToCategory {\n creatorProfileId Int\n categoryId Int\n\n creatorProfile CreatorProfile @relation(fields: [creatorProfileId], references: [id], onDelete: Cascade)\n category Category @relation(fields: [categoryId], references: [id])\n\n @@id([creatorProfileId, categoryId])\n}\n\nmodel Chat {\n id Int @id @default(autoincrement())\n created DateTime? @default(now())\n conversationId String? @unique\n metaData Json @default(\"{}\")\n\n optInId Int? @unique\n\n optIn OptIn? @relation(fields: [optInId], references: [id])\n messages Message[]\n\n @@map(\"chat\")\n}\n\nmodel Message {\n id Int @id @default(autoincrement())\n created DateTime? @default(now())\n sender String\n content String @db.Text\n read Boolean @default(false)\n type String @default(\"text\")\n messageSid String?\n\n userId Int?\n chatId Int\n\n user User? @relation(fields: [userId], references: [id])\n chat Chat @relation(fields: [chatId], references: [id], onDelete: Cascade)\n\n @@index([chatId])\n @@map(\"message\")\n}\n\nmodel Campaign {\n id Int @id @default(autoincrement())\n title String\n slug String? @unique\n status String @default(\"draft\") // draft, paused, pending, private, publish, trash\n date DateTime @default(now())\n publishDate DateTime?\n sfSyncDate DateTime?\n description String? @db.Text\n productDescription String? @db.Text\n prizeDescription String? @db.Text\n strategy String? @default(\"shoutout\")\n socialChannel String?\n socialChannels Json?\n facebookReach Int?\n facebookEngagement Float?\n instagramReach Int?\n instagramEngagement Float?\n youtubeReach Int?\n youtubeEngagement Float?\n twitterReach Int?\n twitterEngagement Float?\n tiktokReach Int?\n tiktokEngagement Float?\n twitchReach Int?\n twitchEngagement Float?\n quantity Int @default(0)\n holdCost Float?\n value Float?\n paidAmount Float?\n minAge Int?\n maxAge Int?\n visuals String? @db.Text\n photoTags Json?\n hashtags Json?\n storyHashtags Json?\n storyMentions Json?\n caption String? @db.Text\n password String?\n contentFormats Json?\n paidCampaign Boolean?\n minPaidAmount Float?\n maxPaidAmount Float?\n paymentType String?\n monthlyActivatedGoal Int? // Redundant/Deprecated\n expectedOptIns Int? // Redundant/Deprecated\n goalActivations Float?\n goalOptIns Float?\n requiresShipping Boolean?\n disableQualifications Boolean?\n disableActivations Boolean?\n affiliateLinkPath String?\n metaData Json @default(\"{}\")\n\n steps CampaignStep[]\n categories CampaignToCategory[]\n optIns OptIn[]\n images CampaignToImage[]\n variables Variable[]\n productLists CampaignToProductList[]\n countries CampaignToCountry[]\n campaignPins CampaignPin[]\n socialPosts SocialPost[]\n campaignInvites CampaignInvite[]\n campaignToShopifyProducts CampaignToShopifyProduct[]\n campaignToBrandAffiliateLinks CampaignToBrandAffiliateLink[]\n linkedPosts CampaignToSocialPost[]\n\n brandId Int\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n creatorLists CreatorList[]\n optInViews OptInView[]\n sequences Sequence[]\n ExternalAffiliateClick ExternalAffiliateClick[]\n\n @@index([brandId])\n @@index([sfSyncDate])\n @@map(\"campaign\")\n}\n\nmodel CampaignPin {\n id Int @id @default(autoincrement())\n userId Int\n campaignId Int\n created DateTime @default(now())\n notified DateTime?\n\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n\n @@index([userId])\n @@map(\"campaignpin\")\n}\n\nmodel CampaignToImage {\n id Int @id @default(autoincrement())\n campaignId Int\n type String\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n\n sizes Image[]\n\n @@map(\"campaigntoimage\")\n}\n\nmodel CampaignToBrandAffiliateLink {\n campaignId Int\n brandAffiliateLinkId Int\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n brandAffiliateLink BrandAffiliateLink @relation(fields: [brandAffiliateLinkId], references: [id], onDelete: Cascade)\n\n @@id([campaignId, brandAffiliateLinkId])\n @@index([brandAffiliateLinkId])\n @@map(\"campaigntobrandaffiliatelink\")\n}\n\nmodel CampaignToCategory {\n campaignId Int\n categoryId Int\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n category Category @relation(fields: [categoryId], references: [id])\n\n @@id([campaignId, categoryId])\n @@map(\"campaigntocategory\")\n}\n\nmodel CampaignToCountry {\n campaignId Int\n countryId Int\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n country Country @relation(fields: [countryId], references: [id])\n\n @@id([campaignId, countryId])\n @@map(\"campaigntocountry\")\n}\n\nmodel ProductList {\n id Int @id @default(autoincrement())\n title String\n description String? @db.Text\n metaData Json @default(\"{}\")\n deactivated DateTime?\n\n brandId Int\n\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n items ProductListItem[]\n campaignProductLists CampaignToProductList[]\n\n @@index([brandId])\n @@map(\"product_list\")\n}\n\nmodel ProductListItem {\n id Int @id @default(autoincrement())\n title String\n description String? @db.Text\n metaData Json @default(\"{}\")\n deactivated DateTime?\n\n productListId Int\n productList ProductList @relation(fields: [productListId], references: [id], onDelete: Cascade)\n optins OptinToProductListItem[]\n\n @@index([productListId])\n @@map(\"product_list_item\")\n}\n\nmodel CampaignToProductList {\n campaignId Int\n productListId Int\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n productList ProductList @relation(fields: [productListId], references: [id])\n\n @@id([campaignId, productListId])\n @@index([productListId])\n @@map(\"campaign_to_product_list\")\n}\n\nmodel OptinToProductListItem {\n optInId Int\n productListItemId Int\n\n optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)\n productListItem ProductListItem @relation(fields: [productListItemId], references: [id], onDelete: Cascade)\n\n @@id([optInId, productListItemId])\n @@index([productListItemId])\n @@map(\"optin_to_product_list_item\")\n}\n\nmodel Variable {\n id Int @id @default(autoincrement())\n title String\n description String? @db.Text\n metaData Json @default(\"{}\")\n\n campaignId Int\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n\n options VariableOption[]\n optInVariables OptInVariable[]\n}\n\nmodel VariableOption {\n id Int @id @default(autoincrement())\n title String\n description String? @db.Text\n metaData Json @default(\"{}\")\n\n variableId Int\n\n variable Variable @relation(fields: [variableId], references: [id], onDelete: Cascade)\n\n optInVariables OptInVariable[]\n}\n\nmodel Step {\n id Int @id @default(autoincrement())\n slug String @unique\n title String?\n description String? @db.Text\n data Json?\n\n campaignSteps CampaignStep[]\n\n @@map(\"step\")\n}\n\nmodel CampaignStep {\n id Int @id @default(autoincrement())\n placement Int\n stepSettings Json?\n actionee String?\n instructions String? @db.Text\n customStepTitle String?\n customForm Json?\n metaData Json @default(\"{}\")\n campaignId Int\n stepId Int?\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n step Step? @relation(fields: [stepId], references: [id])\n currentOptIns OptIn[]\n\n optInSteps OptInStep[]\n\n @@index([campaignId])\n @@map(\"campaignstep\")\n}\n\nmodel OptInStep {\n id Int @id @default(autoincrement())\n completed DateTime?\n data Json?\n\n optInId Int\n campaignStepId Int\n socialPostId Int? // temporary for moving shoutoutData to socialPosts\n\n optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)\n campaignStep CampaignStep @relation(fields: [campaignStepId], references: [id], onDelete: Cascade)\n\n @@index([optInId])\n @@index([campaignStepId])\n @@map(\"optinstep\")\n}\n\nmodel Category {\n id Int @id @default(autoincrement())\n slug String @unique\n title String\n\n campaigns CampaignToCategory[]\n brands BrandToCategory[]\n creators CreatorToCategory[]\n\n @@map(\"category\")\n}\n\nmodel OptIn {\n id Int @id @default(autoincrement())\n status String @default(\"pending\")\n created DateTime @default(now())\n activated DateTime?\n completed DateTime?\n cancelled DateTime?\n cancelledData Json @default(\"{}\")\n cancelRequested DateTime?\n reinvited DateTime?\n seen Boolean @default(false)\n instructions String? @db.Text\n paymentAmount Float?\n paymentStatus String @default(\"pending\") // depracated -- refer to trolley payment table\n extraData Json @default(\"{}\")\n favoritedDate DateTime?\n rating Json?\n\n userId Int\n campaignId Int\n currentStepId Int?\n\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n currentStep CampaignStep? @relation(fields: [currentStepId], references: [id])\n\n variables OptInVariable[]\n optInSteps OptInStep[]\n chat Chat?\n campaignInvites CampaignInvite[]\n trolleyPayments TrolleyPayment[]\n affiliateClicks AffiliateClick[]\n productListItems OptinToProductListItem[]\n ExternalAffiliateClick ExternalAffiliateClick[]\n ImpactRadiusEvent ImpactRadiusEvent[]\n CjEvent CjEvent[]\n ShareASaleEvents ShareASaleEvent[]\n shopifyDiscountCodes ShopifyDiscountCode[]\n\n @@index([userId])\n @@index([campaignId])\n @@map(\"optin\")\n}\n\nmodel TrolleyPayment {\n id Int @id @default(autoincrement())\n paymentId String @unique\n type trolleyPaymentType?\n status trolleyPaymentStatus\n optInId Int?\n paymentAmount Int\n metaData Json @default(\"{}\")\n\n optIn OptIn? @relation(fields: [optInId], references: [id])\n}\n\nenum trolleyPaymentType {\n optIn\n tip\n affiliate\n}\n\nenum trolleyPaymentStatus {\n pending\n processing\n processed\n failed\n returned\n}\n\nmodel OptInVariable {\n id Int @id @default(autoincrement())\n\n optInId Int\n variableId Int\n selectedOptionId Int\n\n optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)\n variable Variable @relation(fields: [variableId], references: [id], onDelete: Cascade)\n selectedOption VariableOption @relation(fields: [selectedOptionId], references: [id], onDelete: Cascade)\n\n @@index([optInId])\n}\n\nmodel SocialPost {\n id Int @id @default(autoincrement())\n externalId String @map(\"external_id\")\n phylloId String? @unique\n metaData Json @default(\"{}\")\n lastFetched DateTime?\n lastWebhook DateTime?\n\n // BASIC INFO\n posted DateTime?\n title String? @db.Text\n description String? @db.Text\n url String? @db.VarChar(2083)\n format String?\n type String?\n platform String?\n visibility String?\n isSponsored Boolean?\n hasCollaborators Boolean?\n isOwnedByUser Boolean?\n // METRICS\n views Int?\n replays Int?\n impressions Int?\n impressionsOrganic Int?\n impressionsPaid Int?\n reach Int?\n reachOrganic Int?\n reachPaid Int?\n watchHours Float?\n // ENGAGEMENT METRICS\n likes Int?\n dislikes Int?\n comments Int?\n saves Int?\n shares Int?\n\n userId Int?\n campaignId Int?\n\n user User? @relation(fields: [userId], references: [id])\n campaign Campaign? @relation(fields: [campaignId], references: [id])\n lists ListToSocialPost[]\n campaigns CampaignToSocialPost[]\n\n @@unique([platform, externalId])\n @@index(campaignId)\n @@index(userId)\n @@index(posted)\n @@map(\"socialpost\")\n}\n\nenum CampaignToSocialPostStatus {\n pending\n approved\n declined\n}\n\nmodel CampaignToSocialPost {\n campaignId Int @map(\"campaign_id\")\n socialPostId Int @map(\"social_post_id\")\n\n status CampaignToSocialPostStatus @default(pending)\n created DateTime @default(now())\n metaData Json @default(\"{}\")\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n socialPost SocialPost @relation(fields: [socialPostId], references: [id], onDelete: Cascade)\n\n @@id([campaignId, socialPostId])\n @@index(status)\n @@map(\"campaign_to_social_post\")\n}\n\n// Table for storing archived socialposts from before external_id was implemented\nmodel ArchivedSocialPost {\n id Int @id @default(autoincrement())\n phylloId String? @unique\n metaData Json @default(\"{}\")\n lastFetched DateTime?\n lastWebhook DateTime?\n\n // BASIC INFO\n posted DateTime?\n title String? @db.Text\n description String? @db.Text\n url String? @db.VarChar(2083)\n urlPath String? @unique // DEPRECATED: This is here so we have some external identifier to quickly search by\n format String?\n type String?\n platform String?\n visibility String?\n isSponsored Boolean?\n hasCollaborators Boolean?\n isOwnedByUser Boolean?\n // METRICS\n views Int?\n impressions Int?\n impressionsOrganic Int?\n impressionsPaid Int?\n reach Int?\n reachOrganic Int?\n reachPaid Int?\n watchHours Float?\n // ENGAGEMENT METRICS\n likes Int?\n dislikes Int?\n comments Int?\n saves Int?\n shares Int?\n\n userId Int?\n campaignId Int?\n\n @@map(\"archived_social_post\")\n}\n\nmodel Image {\n id Int @id @default(autoincrement())\n url String @db.VarChar(2083)\n size String\n campaignImageId Int\n\n campaignImage CampaignToImage @relation(fields: [campaignImageId], references: [id], onDelete: Cascade)\n\n @@map(\"image\")\n}\n\nmodel BrandImage {\n id Int @id @default(autoincrement())\n url String @db.VarChar(2083)\n size String\n brandImageId Int\n\n brandImage BrandToImage @relation(fields: [brandImageId], references: [id], onDelete: Cascade)\n\n @@index([brandImageId])\n @@map(\"brandimage\")\n}\n\nmodel Country {\n id Int @id @default(autoincrement())\n countryCode String @unique @db.VarChar(2)\n countryName String @db.VarChar(500)\n teleCode String @db.VarChar(10)\n states State[]\n\n campaigns CampaignToCountry[]\n\n @@map(\"country\")\n}\n\nmodel State {\n id Int @id @default(autoincrement())\n countryId Int\n stateCode String @db.VarChar(50)\n stateName String @db.VarChar(500)\n\n country Country @relation(fields: [countryId], references: [id])\n\n @@map(\"state\")\n}\n\nmodel PaymentTransaction {\n id Int @id @default(autoincrement())\n amount Float\n balance Float\n type String\n date DateTime @default(now())\n notes String? @db.Text\n metaData Json @default(\"{}\")\n accountId Int\n\n brandId Int?\n creatorId Int?\n prevTransactionId Int? @unique\n\n brand Brand? @relation(fields: [brandId], references: [id])\n creator User? @relation(fields: [creatorId], references: [id])\n prevTransaction PaymentTransaction? @relation(\"TransactionHistory\", fields: [prevTransactionId], references: [id])\n nextTransaction PaymentTransaction? @relation(\"TransactionHistory\")\n\n @@index([accountId])\n}\n\nmodel ExternalAffiliateClick {\n id Int @id @default(autoincrement())\n program String\n created DateTime @default(now())\n ipv4 String?\n ipv6 String?\n linkUrl String\n metaData Json @default(\"{}\")\n\n optInId Int\n campaignId Int\n\n optin OptIn @relation(fields: [optInId], references: [id])\n campaign Campaign @relation(fields: [campaignId], references: [id])\n\n @@index([optInId])\n @@map(\"external_affiliate_click\")\n}\n\nmodel BrandAffiliateLink {\n id Int @id @default(autoincrement())\n created DateTime @default(now())\n description String?\n urlPath String\n commission Float @default(0.2)\n metaData Json @default(\"{}\")\n\n brandId Int\n affiliateLinks AffiliateLink[]\n campaignToBrandAffiliateLink CampaignToBrandAffiliateLink[]\n\n brand Brand @relation(fields: [brandId], references: [id])\n\n @@index([brandId])\n}\n\nmodel AffiliateLink {\n id Int @id @default(autoincrement())\n created DateTime @default(now())\n metaData Json @default(\"{}\")\n\n userId Int\n brandAffiliateLinkId Int\n affiliateClicks AffiliateClick[]\n\n affiliate User @relation(fields: [userId], references: [id])\n brandAffiliateLink BrandAffiliateLink @relation(fields: [brandAffiliateLinkId], references: [id])\n}\n\nmodel AffiliateClick {\n id Int @id @default(autoincrement())\n created DateTime @default(now())\n // visitorIp === IPv4\n visitorIp String?\n IPv6 String?\n optInId Int\n metaData Json @default(\"{}\")\n\n affiliateLinkId Int\n\n optin OptIn @relation(fields: [optInId], references: [id])\n affiliateLink AffiliateLink @relation(fields: [affiliateLinkId], references: [id])\n affiliateEvent AffiliateEvent[]\n}\n\nmodel AffiliateEvent {\n id Int @id @default(autoincrement())\n event String // click, purchase, etc.\n created DateTime @default(now())\n visitorIp String?\n urlPath String?\n revenue Float?\n commissionAmount Float?\n commissionPercent Float?\n metaData Json @default(\"{}\")\n\n affiliateClickId Int\n\n affiliateClick AffiliateClick? @relation(fields: [affiliateClickId], references: [id])\n}\n\nmodel SavedFile {\n id Int @id @default(autoincrement())\n title String?\n type String? // audience-report, search-export, campaign-invite\n url String?\n savedDate DateTime?\n metaData Json? @default(\"{}\")\n\n brandId Int?\n brand Brand? @relation(fields: [brandId], references: [id])\n\n @@map(\"savedfile\")\n}\n\nmodel CampaignInvite {\n id Int @id @default(autoincrement())\n socialProfileId Int?\n brandId Int\n campaignId Int?\n optInId Int? @unique\n code String? @unique\n createdAt DateTime @default(now())\n declineDate DateTime?\n declineReason String? @db.Text\n\n metaData Json? @default(\"{}\")\n\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n campaign Campaign? @relation(fields: [campaignId], references: [id])\n socialProfile SocialProfile? @relation(fields: [socialProfileId], references: [id])\n optIn OptIn? @relation(fields: [optInId], references: [id])\n\n @@index([socialProfileId])\n}\n\nmodel CreatorList {\n id Int @id @default(autoincrement())\n brandId Int\n campaignId Int?\n created DateTime @default(now())\n archived DateTime?\n title String\n metaData Json? @default(\"{}\")\n\n creators CreatorListItem[]\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n campaign Campaign? @relation(fields: [campaignId], references: [id])\n sequences Sequence[]\n\n @@index([brandId])\n @@map(\"creatorlist\")\n}\n\nmodel CreatorListItem {\n id Int @id @default(autoincrement())\n socialProfileId Int\n creatorListId Int\n\n saved DateTime @default(now())\n invited DateTime?\n tags Json?\n feedback String? @db.Text\n archived DateTime?\n metaData Json? @default(\"{}\")\n\n creatorList CreatorList @relation(fields: [creatorListId], references: [id], onDelete: Cascade)\n socialProfile SocialProfile? @relation(fields: [socialProfileId], references: [id], onDelete: Cascade)\n\n sequenceOutboundEmails SequenceOutboundEmail[]\n sequenceInboundEmails SequenceInboundEmail[]\n sequenceImapCheckpoints SequenceImapCheckpoint[]\n\n @@index([creatorListId])\n @@map(\"creatorlistitem\")\n}\n\nmodel SocialProfile {\n id Int @id @default(autoincrement())\n socialId String? @unique // need to make sure this can never overlap across multiple platforms, we should append the platform to the beginning to ensure it’s always unique\n userId Int? // registered user id, if available\n\n // social data\n platform String\n username String\n fullname String? @db.VarChar(1024)\n profileUrl String?\n profilePicUrl String? @db.VarChar(2083) // need to specify length, default size is too small\n followerCount Int?\n engagement Float?\n avgViews Int?\n verified Boolean?\n visibility String @default(\"public\")\n metaData Json @default(\"{}\")\n audienceData Json @default(\"{}\")\n phylloData Json @default(\"{}\")\n\n created DateTime @default(now())\n updated DateTime?\n\n creatorListItems CreatorListItem[]\n campaignInvites CampaignInvite[]\n user User? @relation(fields: [userId], references: [id])\n\n @@index(username)\n @@index(userId)\n @@map(\"socialprofile\")\n}\n\nmodel MessageTemplate {\n id Int @id @default(autoincrement())\n label String?\n template String @db.Text\n brandId Int?\n brand Brand? @relation(fields: [brandId], references: [id])\n metaData Json @default(\"{}\") // to save any additional data such as user defined variables\n\n @@index([brandId])\n @@map(\"messagetemplate\")\n}\n\nmodel EmailTemplate {\n id Int @id @default(autoincrement())\n label String?\n subject String?\n template String @db.Text\n brandId Int?\n\n brand Brand? @relation(fields: [brandId], references: [id])\n metaData Json @default(\"{}\") // to save any additional data such as user defined variables\n\n sequenceSteps SequenceStep[]\n\n @@index([brandId])\n}\n\nmodel SocialListeningList {\n id Int @id @default(autoincrement())\n brandId Int\n campaignId Int? @unique // optionally linked to a campaign\n created DateTime @default(now())\n updated DateTime?\n title String\n postType String // sponsored posts, top posts, or recent posts\n filters Json? @default(\"{}\") // filters to search posts by (location, date, hashtags, mentions, etc.)\n\n lastFetched DateTime? // last time posts were fetched\n\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n posts ListToSocialPost[]\n\n @@map(\"sociallisteninglist\")\n}\n\nmodel ListToSocialPost {\n id Int @id @default(autoincrement())\n listId Int\n postId Int\n\n list SocialListeningList @relation(fields: [listId], references: [id], onDelete: Cascade)\n socialPost SocialPost @relation(fields: [postId], references: [id], onDelete: Cascade)\n\n @@index([listId, postId])\n @@index([postId])\n @@map(\"listtosocialpost\")\n}\n\nmodel OptInView {\n id Int @id @default(autoincrement())\n title String\n filters Json @default(\"{}\")\n\n campaignId Int?\n campaign Campaign? @relation(fields: [campaignId], references: [id])\n\n @@map(\"optinview\")\n}\n\nmodel RakutenActivity {\n id Int @id @default(autoincrement())\n orderId String?\n metaData Json @default(\"{}\")\n created DateTime @default(now())\n clicks Int?\n orders Int?\n sales Float?\n commission Float?\n advertiserId Int?\n\n userId Int\n\n user User @relation(fields: [userId], references: [id])\n\n @@map(\"rakutenactivity\")\n}\n\nmodel ImpactRadiusEvent {\n id Int @id @default(autoincrement())\n type String // action/click\n created DateTime @default(now())\n amount Float?\n commission Float?\n metaData Json @default(\"{}\")\n\n userId Int\n brandId Int?\n optInId Int?\n\n user User @relation(fields: [userId], references: [id])\n brand Brand? @relation(fields: [brandId], references: [id])\n optIn OptIn? @relation(fields: [optInId], references: [id])\n}\n\nmodel CjEvent {\n id Int @id @default(autoincrement())\n type String // action/click\n created DateTime @default(now())\n amount Float?\n commission Float?\n metaData Json @default(\"{}\")\n\n userId Int\n brandId Int?\n optInId Int?\n\n user User @relation(fields: [userId], references: [id])\n brand Brand? @relation(fields: [brandId], references: [id])\n optIn OptIn? @relation(fields: [optInId], references: [id])\n\n @@map(\"cjevent\")\n}\n\nmodel ShareASaleEvent {\n id Int @id @default(autoincrement())\n transactionId String? @unique @map(\"transaction_id\")\n created DateTime @default(now())\n saleAmount Decimal? @map(\"sale_amount\") @db.Decimal(9, 2)\n commission Decimal? @db.Decimal(9, 2)\n metaData Json @default(\"{}\") @map(\"meta_data\")\n\n optInId Int? @map(\"optin_id\")\n\n optIn OptIn? @relation(fields: [optInId], references: [id])\n\n @@map(\"shareasale_event\")\n}\n\nmodel CreatorSearchFilter {\n id Int @id @default(autoincrement())\n brandId Int\n title String\n filters Json @default(\"{}\")\n createdAt DateTime @default(now())\n updatedAt DateTime?\n brand Brand @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@map(\"creatorsearchfilter\")\n}\n\nmodel Sequence {\n id Int @id @default(autoincrement())\n campaignId Int\n creatorListId Int\n title String @db.VarChar(255)\n createdAt DateTime @default(now())\n completed Boolean @default(false)\n brandId Int\n enabled Boolean @default(false)\n\n campaign Campaign @relation(fields: [campaignId], references: [id])\n creatorList CreatorList @relation(fields: [creatorListId], references: [id])\n brand Brand @relation(fields: [brandId], references: [id])\n\n steps SequenceStep[]\n outboundEmails SequenceOutboundEmail[]\n inboundEmails SequenceInboundEmail[]\n imapCheckpoints SequenceImapCheckpoint[]\n\n @@map(\"sequence\")\n}\n\nmodel SequenceStep {\n id Int @id @default(autoincrement())\n sequenceId Int\n createdAt DateTime @default(now())\n emailTemplateId Int\n daysAfterPrevious Int\n order Int\n stepId Int\n\n sequence Sequence @relation(fields: [sequenceId], references: [id], onDelete: Cascade)\n emailTemplate EmailTemplate @relation(fields: [emailTemplateId], references: [id])\n\n outboundEmails SequenceOutboundEmail[]\n\n @@map(\"sequencestep\")\n}\n\nmodel SequenceOutboundEmail {\n id Int @id @default(autoincrement())\n sequenceId Int\n creatorListItemId Int\n sequenceStepId Int\n sentAt DateTime @default(now())\n\n sequence Sequence @relation(fields: [sequenceId], references: [id])\n creatorList CreatorListItem @relation(fields: [creatorListItemId], references: [id])\n sequenceStep SequenceStep @relation(fields: [sequenceStepId], references: [id])\n\n @@map(\"sequenceoutboundemail\")\n}\n\nmodel SequenceInboundEmail {\n id Int @id @default(autoincrement())\n sequenceId Int\n creatorListItemId Int\n receivedAt DateTime @default(now())\n msgHash String\n\n sequence Sequence @relation(fields: [sequenceId], references: [id])\n creatorListId CreatorListItem @relation(fields: [creatorListItemId], references: [id])\n\n @@map(\"sequenceinboundemail\")\n}\n\nmodel SequenceImapCheckpoint {\n sequenceId Int\n creatorListItemId Int\n lastReadMsgDate DateTime @default(now())\n createdAt DateTime @default(now())\n updatedAt DateTime @default(now())\n\n sequence Sequence @relation(fields: [sequenceId], references: [id])\n creatorListId CreatorListItem @relation(fields: [creatorListItemId], references: [id])\n\n @@id([sequenceId, creatorListItemId])\n @@map(\"sequenceimapcheckpoint\")\n}\n\nmodel ShopifyStore {\n id Int @id @default(autoincrement())\n name String?\n url String\n accessToken String? @map(\"access_token\")\n syncStatus ShopifyStoreSyncStatus @default(syncing) @map(\"sync_status\")\n lastSynced DateTime? @map(\"last_synced\")\n metaData Json @default(\"{}\") @map(\"meta_data\")\n\n brandId Int @map(\"brand_id\")\n\n products ShopifyProduct[]\n\n brand Brand? @relation(fields: [brandId], references: [id], onDelete: Cascade)\n\n @@index([brandId])\n @@map(\"shopify_store\")\n}\n\nenum ShopifyStoreSyncStatus {\n syncing\n synced\n error\n}\n\nmodel ShopifyProduct {\n id Int @id @default(autoincrement())\n shopifyId String @unique @map(\"shopify_id\")\n title String\n handle String\n imageUrl String @map(\"image_url\") @db.Text\n\n metaData Json @default(\"{}\") @map(\"meta_data\")\n\n shopifyStoreId Int @map(\"shopify_store_id\")\n\n campaignToShopifyProducts CampaignToShopifyProduct[]\n variations ShopifyProductVariation[]\n\n shopifyStore ShopifyStore @relation(fields: [shopifyStoreId], references: [id], onDelete: Cascade)\n\n @@map(\"shopify_product\")\n}\n\nmodel ShopifyProductVariation {\n id Int @id @default(autoincrement())\n shopifyId String @unique @map(\"shopify_id\")\n title String\n imageUrl String @map(\"image_url\") @db.Text\n\n metaData Json @default(\"{}\") @map(\"meta_data\")\n\n shopifyProductId Int @map(\"shopify_product_id\")\n\n shopifyProduct ShopifyProduct @relation(fields: [shopifyProductId], references: [id], onDelete: Cascade)\n\n @@map(\"shopify_product_variation\")\n}\n\nmodel CampaignToShopifyProduct {\n campaignId Int @map(\"campaign_id\")\n shopifyProductId Int @map(\"shopify_product_id\")\n\n campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)\n shopifyProduct ShopifyProduct @relation(fields: [shopifyProductId], references: [id], onDelete: Cascade)\n\n @@id([campaignId, shopifyProductId])\n @@map(\"campaign_to_shopify_product\")\n}\n\nmodel ShopifyDiscountCode {\n id Int @id @default(autoincrement())\n code String @unique\n shopifyDiscountCodeId Int? @unique @map(\"shopify_discount_code_id\")\n shopifyPriceRuleId BigInt? @map(\"price_rule_id\")\n\n optInId Int @map(\"optin_id\")\n\n optIn OptIn @relation(fields: [optInId], references: [id], onDelete: Cascade)\n\n shopifySales ShopifySale[]\n\n @@map(\"shopify_discount_code\")\n}\n\nmodel ShopifySale {\n id Int @id @default(autoincrement())\n amount Float\n metaData Json? @map(\"meta_data\")\n discountCodeId Int @map(\"discount_code_id\")\n created DateTime @default(now())\n\n discountCode ShopifyDiscountCode @relation(fields: [discountCodeId], references: [id], onDelete: Cascade)\n\n @@map(\"shopify_sale\")\n}\n\nmodel CreatorFlag {\n // Used by admins to flag creators for various reasons\n id Int @id @default(autoincrement())\n label String // reason for flagging (e.g. Scammer)\n comment String? @db.Text // optional comment from admin\n color String // customizable tag color\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n userId Int // user ID of the flagged creator\n user User @relation(\"UserAssignedFlags\", fields: [userId], references: [id])\n\n flaggedByUserId Int // user ID of the admin who flagged the creator\n flaggedByUser User @relation(\"UserCreatedFlags\", fields: [flaggedByUserId], references: [id])\n\n editedByUserId Int? // user ID of the admin who last edited the flag\n editedByUser User? @relation(\"UserEditedFlags\", fields: [editedByUserId], references: [id])\n}\n",
|
|
1588
|
+
"inlineSchemaHash": "294df5cb35eda6e912059e3139efe7c5e5a3a9c25d10aa02df336aa940499c90",
|
|
1585
1589
|
"copyEngine": true
|
|
1586
1590
|
}
|
|
1587
1591
|
|
|
@@ -1645,6 +1649,10 @@ path.join(process.cwd(), "client/creatorco/client/libquery_engine-linux-musl-arm
|
|
|
1645
1649
|
// file annotations for bundling tools to include these files
|
|
1646
1650
|
path.join(__dirname, "libquery_engine-linux-arm64-openssl-1.0.x.so.node");
|
|
1647
1651
|
path.join(process.cwd(), "client/creatorco/client/libquery_engine-linux-arm64-openssl-1.0.x.so.node")
|
|
1652
|
+
|
|
1653
|
+
// file annotations for bundling tools to include these files
|
|
1654
|
+
path.join(__dirname, "libquery_engine-linux-musl-arm64-openssl-1.1.x.so.node");
|
|
1655
|
+
path.join(process.cwd(), "client/creatorco/client/libquery_engine-linux-musl-arm64-openssl-1.1.x.so.node")
|
|
1648
1656
|
// file annotations for bundling tools to include these files
|
|
1649
1657
|
path.join(__dirname, "schema.prisma");
|
|
1650
1658
|
path.join(process.cwd(), "client/creatorco/client/schema.prisma")
|
|
Binary file
|
package/package.json
CHANGED
package/schema.prisma
CHANGED
|
@@ -19,7 +19,7 @@ generator client {
|
|
|
19
19
|
output = "../../client/creatorco/client"
|
|
20
20
|
previewFeatures = ["fullTextIndex", "fullTextSearch"]
|
|
21
21
|
// macos (arm or x86), native, linux arm64 ssl3.x, windows
|
|
22
|
-
binaryTargets = ["native", "darwin", "darwin-arm64", "linux-arm64-openssl-3.0.x", "windows", "debian-openssl-3.0.x", "linux-musl-arm64-openssl-3.0.x", "linux-arm64-openssl-1.0.x"]
|
|
22
|
+
binaryTargets = ["native", "darwin", "darwin-arm64", "linux-arm64-openssl-3.0.x", "windows", "debian-openssl-3.0.x", "linux-musl-arm64-openssl-3.0.x", "linux-arm64-openssl-1.0.x", "linux-musl-arm64-openssl-1.1.x"]
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
datasource db {
|