Magento: what is parent_id field on sales_flat_order_payment table?

magento

Solution

The output of `show create table sales_flat_order_payment;` is:

CONSTRAINT `FK_SALES_FLAT_ORDER_PAYMENT_PARENT_ID_SALES_FLAT_ORDER_ENTITY_ID` 
  FOREIGN KEY  (`parent_id`) REFERENCES `sales_flat_order` (`entity_id`) 
  ON DELETE CASCADE ON UPDATE CASCADE

Means you are absolutely right, that `parent_id` references to `entity_id` in `sales_flat_order`

Problem

What is the `parent_id` field on `sales_flat_order_payment` table for ? I would guess it's the `entity_id` from `sales_flat_order`, but if I read it correctly then according to http://www.magereverse.com/index/magento-database-diagram/version/1-7-0-1 the actual `entity_id` on the `sales_flat_order_payment` table refers to the `entity_id` on the `sales_flat_order` table instead. On our production machine, the parent_ids all match the `entity_id`s on the `sales_flat_order_payment`. On our dev machine, some match and some do not. Is this to be expected ? Using magento 1.7.0.1 Thanks

Original source