inklabs / kommerce-core

PHP shopping cart core platform
https://kommerce-laravel-demo.jamieisaacs.com/
Apache License 2.0
65 stars 14 forks source link

Add UUID to Entities #24

Closed pdt256 closed 8 years ago

pdt256 commented 8 years ago

A Command constructor will likely be the place a UUID is generated. We can also look into UUID generation in the Entity constructor.

What are the pros and cons of using the UUID as the primary key for the Entity tables?

pdt256 commented 8 years ago

Resources: https://github.com/ramsey/uuid https://www.percona.com/blog/2014/12/19/store-uuid-optimized-way/ https://github.com/ramsey/uuid-doctrine

pdt256 commented 8 years ago

First implementation: 720984c2c30d35d1a150a5edef6fa433113955db

pdt256 commented 8 years ago

changes in branch: uuid_migration

pdt256 commented 8 years ago

Replacing the auto_increment on Order.id in favor of a UUID will cause side-effects with the order # generation.

The SequentialReferenceNumberGenerator will become invalid. It will have to be removed in favor of the HashSegmentReferenceNumberGenerator.

This will also enable us to remove ReferenceNumberEntityInterface:: getReferenceId() since the Sequential generator was the only client.