fixing aggregate_column

aggregate_column doesn't work if foreign table pk is in foreign key with current table