You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exportconstprisma=newPrismaClient({log: ["error"],});constallModelNames=Object.keys(Prisma.ModelName).reduce((acc,key)=>{acc[key]=true;returnacc;},{}asRecord<string,boolean>);prisma.$use(createSoftDeleteMiddleware({models: allModelNames,// configuration to include all models in soft delete middlewaredefaultConfig: {field: "deletedAt",allowToOneUpdates: true,createValue: (deleted)=>{if(deleted)returnnewDate();returnnull;},},}));
All of the models in my application have translations relation for my multilanguage app. I will provide an example below:
modelSchool {idString@id@default(uuid())abbreviationString@uniqueschoolDeanUser@relation(fields: [schoolDeanId], references: [id], onDelete: Cascade)schoolDeanIdStringprogramsProgram[]academicCalendarsAcademicCalendar[]translationsSchoolTranslation[]// one to many relationdeletedAtDateTime?createdAtDateTime@default(now())updatedAtDateTime@updatedAt}modelSchoolTranslation {idString@id@default(uuid())nameStringlanguageLanguage@relation(fields: [languageId], references: [id], onDelete: Cascade)languageIdStringschoolSchool@relation(fields: [schoolId], references: [id], onDelete: Cascade)schoolIdStringdeletedAtDateTime?createdAtDateTime@default(now())updatedAtDateTime@updatedAt@@unique([name, languageId])}
Is there any way to soft delete the schoolTranslations rows too when deleting school?
The text was updated successfully, but these errors were encountered:
All of the models in my application have translations relation for my multilanguage app. I will provide an example below:
Is there any way to soft delete the schoolTranslations rows too when deleting school?
The text was updated successfully, but these errors were encountered: