From 9fabc66b7ca5c3533b01fa61c157154074171c26 Mon Sep 17 00:00:00 2001 From: timujeen Date: Fri, 27 Mar 2026 14:34:14 +0000 Subject: [PATCH] Fix orphan files query to use publishing_versions table The orphan file detection query referenced the non-existent publishing_posts.data->>'featured_image' column. Updated to use publishing_versions.data->>'featured_image_uuid' which matches the actual schema after the publishing module refactor. --- lib/modules/storage/storage.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/modules/storage/storage.ex b/lib/modules/storage/storage.ex index 597e06977..1bd1e564e 100644 --- a/lib/modules/storage/storage.ex +++ b/lib/modules/storage/storage.ex @@ -748,11 +748,11 @@ defmodule PhoenixKit.Modules.Storage do f.uuid ) )}, - {"phoenix_kit_publishing_posts", + {"phoenix_kit_publishing_versions", dynamic( [f], fragment( - "NOT EXISTS (SELECT 1 FROM phoenix_kit_publishing_posts pp WHERE pp.data->>'featured_image' = ?::text)", + "NOT EXISTS (SELECT 1 FROM phoenix_kit_publishing_versions pv WHERE pv.data->>'featured_image_uuid' = ?::text)", f.uuid ) )},