- All Implemented Interfaces:
- BackupSupport, DatabaseUpgradeTask, UpgradeTask, UpgradeTaskInfo, org.springframework.beans.factory.BeanNameAware
public class LikesDanglingFKCleanupUpgradeTask
extends AbstractUpgradeTask
implements DatabaseUpgradeTask
Previously likes on comments were not deleted when the parent page was removed.
This left dangling foreign keys from the likes table to the content table, see CONFDEV-12298
It runs pre hibernate schema upgrade as we have remapped the contentid property, and so this task needs
to remove any dangling foreign keys before hibernate introduces the foreign key constraint.
It doesn't run in the import tasks as the ReflectiveObjectPersister handles the upgrade of the property in
its upgradeProperty method, and doesn't import if the contentEntityObject is missing.