I Noticed that after deleting a lot of revisions, their location counterparts remained in the {location} table.
This may be a feature, not a bug. Nontheless, occasionally running DELETE location FROM location LEFT JOIN node_revisions ON oid=vid WHERE vid IS NULL AND type='node' removes them for those inclined to want them gone.

Don't forget your backups before you try.

Comments

BachusII’s picture

I can't seem to find a hook I can use to remove the location when its node/revision is deleted.
Guess I'll have to use a cronjob.

Anyway:

SELECT * FROM location WHERE type='node' AND oid NOT IN (SELECT vid FROM node_revisions)

to list them, and

DELETE FROM location WHERE type='node' AND oid NOT IN (SELECT vid FROM node_revisions)

to remove them.

marcp’s picture

I think you're looking for hook_nodeapi('delete revision') -- take a look at forum.module's hook_nodeapi.

bdragon’s picture

Status: Active » Closed (duplicate)

Marking as duplicate of http://drupal.org/node/110334.