Skip to content

Instantly share code, notes, and snippets.

@skwashd
Created October 13, 2013 12:29
Show Gist options
  • Save skwashd/6961779 to your computer and use it in GitHub Desktop.
Save skwashd/6961779 to your computer and use it in GitHub Desktop.
Want to fix deploy_manager_entities data for the bean module after upgrading to 1.2 or 1.4? Try this query.
UPDATE deploy_manager_entities dme
JOIN (
SELECT br.bid, MAX(br.vid) max_vid
FROM bean_revision br
INNER JOIN deploy_manager_entities dme
ON br.bid = dme.entity_id
GROUP BY br.bid
) b
ON b.bid = dme.entity_id
SET dme.revision_id = b.max_vid
WHERE dme.entity_type = 'bean';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment