From 1cde8fd72441181ef469ca993298f24a641c6d93 Mon Sep 17 00:00:00 2001 From: Angelo Reale <12191809+angeloreale@users.noreply.github.com> Date: Tue, 7 Jan 2025 21:35:35 +0100 Subject: [PATCH] ar(fix) [DPCP-NAN]: schemas FY --- .../private/prisma/schema/__auth-sec.prisma | 40 +++++++++++- prisma/private/prisma/schema/_write.prisma | 64 +++++++++---------- 2 files changed, 70 insertions(+), 34 deletions(-) diff --git a/prisma/private/prisma/schema/__auth-sec.prisma b/prisma/private/prisma/schema/__auth-sec.prisma index 22eab10c..6d1c068f 100644 --- a/prisma/private/prisma/schema/__auth-sec.prisma +++ b/prisma/private/prisma/schema/__auth-sec.prisma @@ -130,6 +130,24 @@ model User { ownedIdeas WriteIdeas[] @relation("writeIdeasUserOwner") createdIdeas WriteIdeas[] @relation("writeIdeasUserCreator") + ownedPublications WritePublications[] @relation("writePublicationsUserOwner") + createdPublications WritePublications[] @relation("writePublicationsUserCreator") + + ownedWits WriteWits[] @relation("writeWitsUserOwner") + createdWits WriteWits[] @relation("writeWitsUserCreator") + + ownedCogitos WriteCogitos[] @relation("writeCogitosUserOwner") + createdCogitos WriteCogitos[] @relation("writeCogitosUserCreator") + + ownedHopes WriteHopes[] @relation("writeHopesUserOwner") + createdHopes WriteHopes[] @relation("writeHopesUserCreator") + + ownedOpinions WriteOpinions[] @relation("writeOpinionsUserOwner") + createdOpinions WriteOpinions[] @relation("writeOpinionsUserCreator") + + ownedThreads WriteThreads[] @relation("writeThreadsUserOwner") + createdThreads WriteThreads[] @relation("writeThreadsUserCreator") + ownedQuests DoQuests[] @relation("doQuestUserOwner") createdQuests DoQuests[] @relation("doQuestUserCreator") @@ -188,8 +206,26 @@ model Communities { ownedDos Dos[] @relation("doDosCommunityOwner") createdDos Dos[] @relation("doDosCommunityCreator") - ownedIdeas WriteIdeas[] @relation("ideaCommunityOwner") - createdIdeas WriteIdeas[] @relation("writeIdeaCommunityCreator") + ownedIdeas WriteIdeas[] @relation("writeIdeasCommunityOwner") + createdIdeas WriteIdeas[] @relation("writeIdeasCommunityCreator") + + ownedPublications WritePublications[] @relation("writePublicationsCommunityOwner") + createdPublications WritePublications[] @relation("writePublicationsCommunityCreator") + + ownedWits WriteWits[] @relation("writeWitsCommunityOwner") + createdWits WriteWits[] @relation("writeWitsCommunityCreator") + + ownedCogitos WriteCogitos[] @relation("writeCogitosCommunityOwner") + createdCogitos WriteCogitos[] @relation("writeCogitosCommunityCreator") + + ownedHopes WriteHopes[] @relation("writeHopesCommunityOwner") + createdHopes WriteHopes[] @relation("writeHopesCommunityCreator") + + ownedOpinions WriteOpinions[] @relation("writeOpinionsCommunityOwner") + createdOpinions WriteOpinions[] @relation("writeOpinionsCommunityCreator") + + ownedThreads WriteThreads[] @relation("writeThreadsCommunityOwner") + createdThreads WriteThreads[] @relation("writeThreadsCommunityCreator") ownedQuests DoQuests[] @relation("questCommunityOwner") createdQuests DoQuests[] @relation("doQuestCommunityCreator") diff --git a/prisma/private/prisma/schema/_write.prisma b/prisma/private/prisma/schema/_write.prisma index 4aaf2ff2..6338ec41 100644 --- a/prisma/private/prisma/schema/_write.prisma +++ b/prisma/private/prisma/schema/_write.prisma @@ -16,16 +16,16 @@ model WriteIdeas { loggedFor DateTime[] @db.Date publishedOn DateTime @db.Date - userOwner User? @relation("thoughtUserOwner", fields: [userOwnerId], references: [id]) + userOwner User? @relation("writeIdeasUserOwner", fields: [userOwnerId], references: [id]) userOwnerId String? @db.ObjectId - communityOwner Communities? @relation("thoughtCommunityOwner", fields: [communityOwnerId], references: [id]) + communityOwner Communities? @relation("writeIdeasCommunityOwner", fields: [communityOwnerId], references: [id]) communityOwnerId String? @db.ObjectId - userCreator User? @relation("thoughtUserCreator", fields: [userCreatorId], references: [id]) + userCreator User? @relation("writeIdeasUserCreator", fields: [userCreatorId], references: [id]) userCreatorId String? @db.ObjectId - communityCreator Communities? @relation("thoughtCommunityCreator", fields: [communityCreatorId], references: [id]) + communityCreator Communities? @relation("writeIdeasCommunityCreator", fields: [communityCreatorId], references: [id]) communityCreatorId String? @db.ObjectId @@map("writeIdeas") @@ -44,16 +44,16 @@ model WriteLearnings { loggedFor DateTime[] @db.Date publishedOn DateTime @db.Date - userOwner User? @relation("thoughtUserOwner", fields: [userOwnerId], references: [id]) + userOwner User? @relation("writeLearningsUserOwner", fields: [userOwnerId], references: [id]) userOwnerId String? @db.ObjectId - communityOwner Communities? @relation("thoughtCommunityOwner", fields: [communityOwnerId], references: [id]) + communityOwner Communities? @relation("writeLearningsCommunityOwner", fields: [communityOwnerId], references: [id]) communityOwnerId String? @db.ObjectId - userCreator User? @relation("thoughtUserCreator", fields: [userCreatorId], references: [id]) + userCreator User? @relation("writeLearningsUserCreator", fields: [userCreatorId], references: [id]) userCreatorId String? @db.ObjectId - communityCreator Communities? @relation("thoughtCommunityCreator", fields: [communityCreatorId], references: [id]) + communityCreator Communities? @relation("writeLearningsCommunityCreator", fields: [communityCreatorId], references: [id]) communityCreatorId String? @db.ObjectId @@map("writeLearnings") @@ -73,16 +73,16 @@ model WriteWits { loggedFor DateTime[] @db.Date publishedOn DateTime @db.Date - userOwner User? @relation("thoughtUserOwner", fields: [userOwnerId], references: [id]) + userOwner User? @relation("writeWitsUserOwner", fields: [userOwnerId], references: [id]) userOwnerId String? @db.ObjectId - communityOwner Communities? @relation("thoughtCommunityOwner", fields: [communityOwnerId], references: [id]) + communityOwner Communities? @relation("writeWitsCommunityOwner", fields: [communityOwnerId], references: [id]) communityOwnerId String? @db.ObjectId - userCreator User? @relation("thoughtUserCreator", fields: [userCreatorId], references: [id]) + userCreator User? @relation("writeWitsUserCreator", fields: [userCreatorId], references: [id]) userCreatorId String? @db.ObjectId - communityCreator Communities? @relation("thoughtCommunityCreator", fields: [communityCreatorId], references: [id]) + communityCreator Communities? @relation("writeWitsCommunityCreator", fields: [communityCreatorId], references: [id]) communityCreatorId String? @db.ObjectId @@map("writeWits") @@ -101,16 +101,16 @@ model WriteCogitos { loggedFor DateTime[] @db.Date publishedOn DateTime @db.Date - userOwner User? @relation("thoughtUserOwner", fields: [userOwnerId], references: [id]) + userOwner User? @relation("writeCogitosUserOwner", fields: [userOwnerId], references: [id]) userOwnerId String? @db.ObjectId - communityOwner Communities? @relation("thoughtCommunityOwner", fields: [communityOwnerId], references: [id]) + communityOwner Communities? @relation("writeCogitosCommunityOwner", fields: [communityOwnerId], references: [id]) communityOwnerId String? @db.ObjectId - userCreator User? @relation("thoughtUserCreator", fields: [userCreatorId], references: [id]) + userCreator User? @relation("writeCogitosUserCreator", fields: [userCreatorId], references: [id]) userCreatorId String? @db.ObjectId - communityCreator Communities? @relation("thoughtCommunityCreator", fields: [communityCreatorId], references: [id]) + communityCreator Communities? @relation("writeCogitosCommunityCreator", fields: [communityCreatorId], references: [id]) communityCreatorId String? @db.ObjectId @@map("writeCogitos") @@ -130,16 +130,16 @@ model WriteHopes { loggedFor DateTime[] @db.Date publishedOn DateTime @db.Date - userOwner User? @relation("thoughtUserOwner", fields: [userOwnerId], references: [id]) + userOwner User? @relation("writeHopesUserOwner", fields: [userOwnerId], references: [id]) userOwnerId String? @db.ObjectId - communityOwner Communities? @relation("thoughtCommunityOwner", fields: [communityOwnerId], references: [id]) + communityOwner Communities? @relation("writeHopesCommunityOwner", fields: [communityOwnerId], references: [id]) communityOwnerId String? @db.ObjectId - userCreator User? @relation("thoughtUserCreator", fields: [userCreatorId], references: [id]) + userCreator User? @relation("writeHopesUserCreator", fields: [userCreatorId], references: [id]) userCreatorId String? @db.ObjectId - communityCreator Communities? @relation("thoughtCommunityCreator", fields: [communityCreatorId], references: [id]) + communityCreator Communities? @relation("writeHopesCommunityCreator", fields: [communityCreatorId], references: [id]) communityCreatorId String? @db.ObjectId @@map("writeHopes") @@ -158,16 +158,16 @@ model WriteThreads { loggedFor DateTime[] @db.Date publishedOn DateTime @db.Date - userOwner User? @relation("thoughtUserOwner", fields: [userOwnerId], references: [id]) + userOwner User? @relation("writeThreadsUserOwner", fields: [userOwnerId], references: [id]) userOwnerId String? @db.ObjectId - communityOwner Communities? @relation("thoughtCommunityOwner", fields: [communityOwnerId], references: [id]) + communityOwner Communities? @relation("writeThreadsCommunityOwner", fields: [communityOwnerId], references: [id]) communityOwnerId String? @db.ObjectId - userCreator User? @relation("thoughtUserCreator", fields: [userCreatorId], references: [id]) + userCreator User? @relation("writeThreadsUserCreator", fields: [userCreatorId], references: [id]) userCreatorId String? @db.ObjectId - communityCreator Communities? @relation("thoughtCommunityCreator", fields: [communityCreatorId], references: [id]) + communityCreator Communities? @relation("writeThreadsCommunityCreator", fields: [communityCreatorId], references: [id]) communityCreatorId String? @db.ObjectId @@map("writeThreads") @@ -187,16 +187,16 @@ model WriteOpinions { loggedFor DateTime[] @db.Date publishedOn DateTime @db.Date - userOwner User? @relation("thoughtUserOwner", fields: [userOwnerId], references: [id]) + userOwner User? @relation("writeOpinionsUserOwner", fields: [userOwnerId], references: [id]) userOwnerId String? @db.ObjectId - communityOwner Communities? @relation("thoughtCommunityOwner", fields: [communityOwnerId], references: [id]) + communityOwner Communities? @relation("writeOpinionsCommunityOwner", fields: [communityOwnerId], references: [id]) communityOwnerId String? @db.ObjectId - userCreator User? @relation("thoughtUserCreator", fields: [userCreatorId], references: [id]) + userCreator User? @relation("writeOpinionsUserCreator", fields: [userCreatorId], references: [id]) userCreatorId String? @db.ObjectId - communityCreator Communities? @relation("thoughtCommunityCreator", fields: [communityCreatorId], references: [id]) + communityCreator Communities? @relation("writeOpinionsCommunityCreator", fields: [communityCreatorId], references: [id]) communityCreatorId String? @db.ObjectId @@map("writeOpinions") @@ -215,16 +215,16 @@ model WritePublications { loggedFor DateTime[] @db.Date publishedOn DateTime @db.Date - userOwner User? @relation("thoughtUserOwner", fields: [userOwnerId], references: [id]) + userOwner User? @relation("writePublicationsUserOwner", fields: [userOwnerId], references: [id]) userOwnerId String? @db.ObjectId - communityOwner Communities? @relation("thoughtCommunityOwner", fields: [communityOwnerId], references: [id]) + communityOwner Communities? @relation("writePublicationsCommunityOwner", fields: [communityOwnerId], references: [id]) communityOwnerId String? @db.ObjectId - userCreator User? @relation("thoughtUserCreator", fields: [userCreatorId], references: [id]) + userCreator User? @relation("writePublicationsUserCreator", fields: [userCreatorId], references: [id]) userCreatorId String? @db.ObjectId - communityCreator Communities? @relation("thoughtCommunityCreator", fields: [communityCreatorId], references: [id]) + communityCreator Communities? @relation("writePublicationsCommunityCreator", fields: [communityCreatorId], references: [id]) communityCreatorId String? @db.ObjectId @@map("writePublications")