Last active
April 25, 2025 08:27
-
-
Save ProNotion/1436b656eb3e8dc18f4bb409ca5a4d56 to your computer and use it in GitHub Desktop.
Umbraco 7 - Retrieve a list of nodes with saved but unpublished changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Retrieves content items that have a newer, unpublished version than the currently published version. | |
SELECT | |
c.nodeId AS ContentId, | |
un.text AS NodeName, | |
CONCAT('https://example.com/umbraco#/content/content/edit/', c.nodeId) AS Link | |
FROM cmsContent c | |
JOIN cmsContentVersion cv ON c.nodeId = cv.ContentId | |
JOIN cmsDocument d ON c.nodeId = d.nodeId | |
JOIN umbracoNode un ON c.nodeId = un.id | |
WHERE cv.id = ( | |
SELECT MAX(cv2.id) | |
FROM cmsContentVersion cv2 | |
WHERE cv2.ContentId = c.nodeId | |
) | |
AND d.published = 1 -- The content has a published version | |
AND d.updateDate < cv.versionDate -- There is a newer, unpublished version | |
ORDER BY c.nodeId; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here for posterity having been used ahead of a large scale migration