In liquibase changeset 201406152043, introduced in OpenMRS 1.10, we add a foreign key that is invalid.
The intent seems to be to add a foreign key from order_type.parent back to order_type, but instead it incorrectly tries to add the link between order_type.parent and order.
The liquibase changeset was introduced in TRUK-4395 as follows:
The result is that any existing implementations with order types and orders will either end up with an upgrade failure (if links to non-existent rows are found), or worse - will end up with links to the wrong tables altogether.
This is a high-priority issue that should be fixed in master and backported back through the 1.11.x and 1.10.x branches