Issue #1651824 by meatsack | joachim: Fixed 'entity_test' table has incorrect declaration of foreign keys.