If you're like me and you create an automatic job to unapprove pages based on specific criteria, and then you mess it up, this might be useful. At one point, the entire table of versions got unapproved. this sucks. Concrete5 goes a little haywire when there is more than one approved version of a page, so the only solution is to re-approve only one version of each page.
-- unapprove the entire database:
UPDATE `CollectionVersions` SET cvIsApproved = 0;
-- approve only the latest version of each page:
UPDATE `CollectionVersions` AS v1
INNER JOIN (SELECT `cID`, MAX(`cvID`) as 'cvID' FROM `CollectionVersions` GROUP BY `cID`) v2
ON v1.`cID` = v2.`cID` AND v1.`cvID` = v2.`cvID`
SET `cvIsApproved` = 1
You are allowed to delete your post for 5 minutes after it's posted.