For example I have 2 commerce_order bundles:

  • commerce_order
  • invoice

And I need have order numbers like [date:custom:Y]-{id} (like 2014-1) for both of them. And {id} not order_id, it's real id of invoice or of order.
And in this case I can have order_number 2014-1 for both. And in this case I see:

DatabaseTransactionOutOfOrderException: in DatabaseConnection->rollback() (line 1059 of /var/www/erpal3/www/includes/database/database.inc).

So added logic for order_number which can be unique only for commerce_order type.
This not change default logic of commerce but gives possibility to works with different commerce order bundles.

Comments

rszrama’s picture

Status: Needs review » Postponed

This looks like it'd work fine for you given your use case, but I'm going to hold off on any schema level changes like this until 2.x. In 1.x we decided to support the possibility of multiple order types without developing the concept any further in core, and changes to this would affect sites with potentially hundreds of thousands / millions of order rows that could fail on update. Best not to rock that boat. : )

alexshipilov’s picture

alexshipilov’s picture

fixed some mistakes in rerolled patch

alexshipilov’s picture

alexshipilov’s picture

andrewsizz’s picture

This patch doesn't works on MyISAM, because on installation we have error:
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes.

In Next patch this error fixed.

ugintl’s picture

Which patch is working?

ugintl’s picture

ugintl’s picture

ugintl’s picture

ugintl’s picture

bojanz’s picture

Status: Postponed » Closed (won't fix)

2.x supports order types properly, it's too late to change this API in 1.x.