Can someone explain the difference between the two tables please?

Thanks

Comments

rszrama’s picture

Status: Active » Closed (won't fix)

Per the issue submission guidelines, we don't offer support in this issue queue. Please repost this question on http://www.drupalcommerce.org/questions and link to it. I'm happy to provide an answer there.

GuyPaddock’s picture

@bsandor: I believe that field_data_commerce_line_items represents the data in the order line items field exposed to Entity API, whereas commerce_line_item stores the line items that the data table points to. The former is an entity reference, while the latter is the actual order line item information.

Technically, the data table should be unnecessary because it's possible to JOIN the order table to the commerce_line_item table via the order_id column of the line item to find the line items for the order. If I had to guess the data table is probably required for the Entity API to be able to navigate the order's relationships.