supporting generic foreign keys