Created
September 1, 2009 22:19
-
-
Save preaction/179429 to your computer and use it in GitHub Desktop.
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
#---------------------------------------------------------------------------- | |
# Remove the orphan version tags, tags with no revisions in them | |
sub removeOrphanedVersionTags { | |
my $session = shift; | |
print "\tRemoving orphan version tags (this may take a while)... " unless $quiet; | |
my $sth = $session->db->read( | |
"SELECT tagId FROM assetVersionTag", | |
); | |
while ( my ($tagId) = $sth->array ) { | |
if ( !$session->db->quickScalar( | |
"SELECT COUNT(*) FROM assetData WHERE tagId=?", | |
[ $tagId ] | |
) ) { | |
my $tag = WebGUI::VersionTag->new( $session, $tagId ); | |
$tag->rollback; | |
} | |
} | |
print "DONE!\n" unless $quiet; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment