[migration/3.21] Add missing foreign keys when upgrading
Try to delete dangling relations, since there's no point in keeping
them.
Related to #4846892.
include *.pyinclude */*.pyrecursive-include data *.gif *.png *.ico *.css *.jsrecursive-include i18n *.porecursive-include wdoc *