From 3b2d618cfcba7598e23d1c580e9b7013e459f482 Mon Sep 17 00:00:00 2001 From: Danijel Martinek Date: Mon, 18 May 2026 19:16:23 +0000 Subject: [PATCH] feat(media): add retention metadata to media collection Adds custom.retention (monthly purge, 90-day post-deletion hard-delete) to the media Payload collection. No uploadedBy field exists in the collection so no custom.pii annotation is needed. --- .../media/src/integrations/cms/collections/media.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/media/src/integrations/cms/collections/media.ts b/packages/media/src/integrations/cms/collections/media.ts index 742d8d9..c4c575c 100644 --- a/packages/media/src/integrations/cms/collections/media.ts +++ b/packages/media/src/integrations/cms/collections/media.ts @@ -2,6 +2,16 @@ import type { CollectionConfig } from "payload"; export const media: CollectionConfig = { slug: "media", + custom: { + retention: { + purgeSchedule: "monthly", + postDeletion: { + duration: "P90D", + trigger: "after-deletion", + action: "hard-delete", + }, + }, + }, upload: { mimeTypes: ["image/*", "application/pdf"], },